public void UpdateDeadPanel(EnemyType enemyType)
    {
        if (gameManager == null)
        {
            gameManager = FindObjectOfType <GameManager>();
        }
        characterReader = gameManager.characterReader;
        skilldata       = characterReader.GetEnemySkillUI(enemyType.ToString());
        data            = characterReader.GetEnemyData(gameManager.enemyManager.getEnemyLevel(enemyType), enemyType.ToString());

        txtname.text  = enemyType.ToString();
        txtdata1.text = gameManager.enemyManager.getEnemyLevel(enemyType) + "\n" + data.HP + "\n" + data.attack + "\n" + data.defense;
        txtdata2.text = data.dexterity + "\n" + data.magicAttack + "\n" + data.magicDefense + "\n" + data.attackRange;

        string skilltext = "";

        for (int i = 0; i < skilldata.Count; i++)
        {
            var strb = new System.Text.StringBuilder(skilldata[i].description);
            for (int j = 0; skilldata[i].description.Length - letterPerLine * j > letterPerLine; j++)
            {
                strb.Insert((7 + letterPerLine) * j + letterPerLine, "\n\u3000\u3000\u3000\u3000\u3000\u3000");
            }
            skilldata[i].description = strb.ToString();
            skilltext += skilldata[i].name.PadRight(6, '\u3000') + skilldata[i].description + "\n";
        }
        skill.text = "<size=22>" + skilltext + "</size>";
    }
Esempio n. 2
0
    public void UpdateAdventurer()
    {
        type = adventurerPage.adventurerList[adventurerPage.currentid];
        string name = type.ToString();

        skilldata   = characterReader.GetEnemySkillUI(name);
        description = characterReader.GetCharacterDescription(PawnType.Enemy, name);

        txtname.text = name;
        string skilltext = "";

        for (int i = 0; i < skilldata.Count; i++)
        {
            var strb = new System.Text.StringBuilder(skilldata[i].description);
            for (int j = 0; skilldata[i].description.Length - 18 * j > 18; j++)
            {
                strb.Insert(25 * j + 18, "\n\u3000\u3000\u3000\u3000\u3000\u3000");
            }
            skilldata[i].description = strb.ToString();
            skilltext += skilldata[i].name.PadRight(6, '\u3000') + skilldata[i].description + "\n";
        }
        skill.text = skilltext;
        story.text = description.story;
        race.text  = description.race;
        desc.text  = description.description;

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