本文整理汇总了C#中Inventory.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Inventory.Init方法的具体用法?C# Inventory.Init怎么用?C# Inventory.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Inventory
的用法示例。
在下文中一共展示了Inventory.Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
// Use this for initialization
public void Init()
{
gm = Camera.main.GetComponent<GameManager>();
curBPdelay = BPdelay;
maxHealth = health;
inv = transform.GetComponent<Inventory>();
inv.Init((int)inventorySize.x, (int)inventorySize.y);
invD = gm.GetComponent<InvDisp>();
invD.Init((int)inventorySize.x, (int)inventorySize.y);
healthBar = gm.PlayerHealthBar;
damageImage = gm.PlayerDamageImage;
InfoText = gm.InfoText;
healthBar.maxValue = maxHealth;
healthBar.value = health;
}
示例2: load
public void load(string s)
{
Debug.Log("PlayerControls::load -- " + s);
string[] values = s.Split(':');
gameObject.name = values[0];
transform.position = new Vector2(float.Parse(values[1]), float.Parse(values[2]));
health = int.Parse(values[3]);
maxHealth = int.Parse(values[4]);
gm = Camera.main.GetComponent<GameManager>();
curBPdelay = BPdelay;
inv = transform.GetComponent<Inventory>();
inv.Init((int)inventorySize.x, (int)inventorySize.y);
string loadinv = values[5];
inv.load(loadinv);
invD = gm.GetComponent<InvDisp>();
invD.Init((int)inventorySize.x, (int)inventorySize.y);
healthBar = gm.PlayerHealthBar;
damageImage = gm.PlayerDamageImage;
healthBar.maxValue = maxHealth;
healthBar.value = health;
}