public void SetGangUnitInformation(GameManager.Gang gang) { Sprite sprite = gang.GetIcon(); Image icon = transform.Find("Icon").GetComponent <Image>(); /* * switch (gang.type) * { * case 0: * sprite = strongGang; * break; * case 1: * sprite = moneyGang; * break; * case 2: * sprite = debuffGang; * break; * case 3: * sprite = globalGang; * break; * case 4: * sprite = levelMaxGang; * break; * } */ icon.sprite = sprite; }
public void SetUnitInformation(int index, GameManager.Gang gang) { this.index = index; job = 2; type = gang.type; string statusText = "Lv " + gang.level; statusText += gang.GetType() + " 갱단"; transform.Find("Status").GetComponent <Text>().text = statusText; transform.Find("Attack").GetComponent <Text>().text = gang.type == 4 ? "" : gang.attack().ToString(); transform.Find("Return").GetComponent <Text>().text = gang.type == 4 ? "" : gang.returnMoney().ToString(); Image icon = transform.Find("Icon").GetComponent <Image>(); Sprite sprite = gang.GetIcon(); if (sprite != null) { icon.sprite = sprite; } }