Exemple #1
0
    public override void ResetPanel()
    {
        for (int i = 0; i < modelList.Count; i++)
        {
            if (modelList[i].activeInHierarchy == true)
            {
                if (i != recentCharacter)
                {
                    modelList[i].SetActive(false);
                    //모델전환애니메이션 삽입위치
                }
            }
        }
        modelList[recentCharacter].SetActive(true);
        //케릭터 스테이터스 갱신
        UnitState temp      = CharacterManager.instance.ResearchUnit(SaveListManager.instance.playerdata.playerList[recentCharacter].unitEntry);
        Item      tempItem1 = ItemManager.instance.ItemResearch(SaveListManager.instance.playerdata.playerList[recentCharacter].itemEntryList[0]);
        Item      tempItem2 = ItemManager.instance.ItemResearch(SaveListManager.instance.playerdata.playerList[recentCharacter].itemEntryList[1]);
        int       level     = SaveListManager.instance.playerdata.playerList[recentCharacter].unitLevel;

        int[] itemValue = new int[4];
        if (tempItem1 != null)
        {
            itemValue[0] += tempItem1.value1;
            itemValue[1] += tempItem1.value2;
            itemValue[2] += tempItem1.value3;
            itemValue[3] += tempItem1.value4;
        }
        if (tempItem2 != null)
        {
            itemValue[0] += tempItem2.value1;
            itemValue[1] += tempItem2.value2;
            itemValue[2] += tempItem2.value3;
            itemValue[3] += tempItem2.value4;
        }
        unitClass.text    = temp.UnitName;
        unitLevel.text    = level.ToString();
        unitStrength.text = temp.Strength(level).ToString();
        if (itemValue[0] != 0)
        {
            unitStrength.text += "(";
            if (itemValue[0] > 0)
            {
                unitStrength.text += "+";
            }
            unitStrength.text += itemValue[0] + ")";
        }
        unitInteligence.text = temp.Intelligence(level).ToString();
        if (itemValue[1] != 0)
        {
            unitInteligence.text += "(";
            if (itemValue[1] > 0)
            {
                unitInteligence.text += "+";
            }
            unitInteligence.text += itemValue[1] + ")";
        }
        unitSpeed.text = temp.Speed(level).ToString();
        if (itemValue[2] != 0)
        {
            unitSpeed.text += "(";
            if (itemValue[2] > 0)
            {
                unitSpeed.text += "+";
            }
            unitSpeed.text += itemValue[2] + ")";
        }
        unitDefence.text = temp.Defence(level).ToString();
        if (itemValue[3] != 0)
        {
            unitDefence.text += "(";
            if (itemValue[3] > 0)
            {
                unitDefence.text += "+";
            }
            unitDefence.text += itemValue[3] + ")";
        }
        //playerIllu.sprite = Resources.Load<Sprite>("Illu\\"+SaveListManager.instance.playerdata.playerList[recentCharacter].UnitName);
        int spellCount = temp.spellEntryList.Length;

        for (int i = 0; i < unitspell.Length; i++)
        {
            unitspell[i].unitItemIcon.gameObject.SetActive(false);
            if (i < spellCount)
            {
                Spell spell = SpellManager.instance.SpellResearch(temp.spellEntryList[i]);
                if (spell == null)
                {
                    continue;
                }
                if (spell.spellIcon != null)
                {
                    unitspell[i].unitItemIcon.sprite = spell.spellIcon;
                }
                unitspell[i].unitItemName.text    = spell.spellName;
                unitspell[i].unitItemContext.text = spell.spellContext;
                unitspell[i].unitItemIcon.gameObject.SetActive(true);
            }
        }
        PlayerItemResetUI();
    }