public void removeCharacter(Character characterObject) { CharacterIconObject charInfo = charIconList[characterObject.CharID]; charIconList.Remove(characterObject.CharID); Destroy(charInfo.gameObject); LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent <RectTransform>()); }
public void addCharacter(Character characterObject) { CharacterIconObject newItem = Instantiate(charIconProto, transform.position, transform.rotation, transform) as CharacterIconObject; //LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent<RectTransform>()); newItem.Init(); newItem.charName.text = characterObject.Name; newItem.portrait.sprite = GameData.instance.characterPortraitDictionary[characterObject.Race]; newItem.charHealth.text = characterObject.getStat("Health") + " / " + "15"; charIconList.Add(characterObject.CharID, newItem); }
public CharIndexContainerCharacterIconObject() { int ageCount = GameConstants.numberAges; Contents = new CharacterIconObject[ageCount][]; for (int i = 0; i < ageCount; i++) { int charCount = GameConstants.numberChoices[i]; for (int j = 0; j < charCount; j++) { Contents[i] = new CharacterIconObject[charCount]; } } }
public void updateCharacterInfo(Character characterObject) { CharacterIconObject charInfo = charIconList[characterObject.CharID]; charInfo.charHealth.text = characterObject.getStat("Health") + " / " + "15"; }