예제 #1
0
    private CharacterReader.CharacterData GetOldData()
    {
        Monster monster = (Monster)currentMonster;

        return(characterReader.GetMonsterData(gameManager.monsterManager.GetMonsterUnlockLevel(monster.monsterType)
                                              , monster.monsterType.ToString(), monster.GetLevel()));
    }
    public void UpdatePreview(MonsterType type)
    {
        name          = type.ToString();
        skilldata     = characterReader.GetMonsterSkillUI(name);
        characterData = characterReader.GetMonsterData(gameManager.monsterManager.GetMonsterUnlockLevel(type), type.ToString(), 1);

        txtname.text = name;
        string skilltext = "";
        var    strb      = new System.Text.StringBuilder(skilldata[0].description);

        for (int j = 0; skilldata[0].description.Length - letterPerLine * j > letterPerLine; j++)
        {
            strb.Insert((7 + letterPerLine) * j + letterPerLine, "\n\u3000\u3000\u3000\u3000\u3000\u3000");
        }
        skilldata[0].description = strb.ToString();
        skilltext += skilldata[0].name.PadRight(6, '\u3000') + skilldata[0].description + "\n";
        skill.text = "<size=22>" + skilltext + "</size>";

        data1.text = "1\n"
                     + (characterData.HP) + "\n"
                     + (characterData.attack) + "\n"
                     + (characterData.defense) + "\n";
        data2.text = (characterData.dexterity) + "\n"
                     + (characterData.magicAttack) + "\n"
                     + (characterData.magicDefense) + "\n"
                     + (characterData.attackRange) + "\n";

        if ((sprite = Resources.Load("Image/character/" + name, typeof(Sprite)) as Sprite) != null)
        {
            image.sprite = sprite;
        }
        else if ((sprite = Resources.Load("Image/character/" + name + "1", typeof(Sprite)) as Sprite) != null)
        {
            image.sprite = sprite;
        }
    }