コード例 #1
0
ファイル: CharacterIconsPanel.cs プロジェクト: haydon19/OTiS
    public void removeCharacter(Character characterObject)
    {
        CharacterIconObject charInfo = charIconList[characterObject.CharID];

        charIconList.Remove(characterObject.CharID);
        Destroy(charInfo.gameObject);
        LayoutRebuilder.ForceRebuildLayoutImmediate(GetComponent <RectTransform>());
    }
コード例 #2
0
ファイル: CharacterIconsPanel.cs プロジェクト: haydon19/OTiS
    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);
    }
コード例 #3
0
    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];
            }
        }
    }
コード例 #4
0
ファイル: CharacterIconsPanel.cs プロジェクト: haydon19/OTiS
    public void updateCharacterInfo(Character characterObject)
    {
        CharacterIconObject charInfo = charIconList[characterObject.CharID];

        charInfo.charHealth.text = characterObject.getStat("Health") + " / " + "15";
    }