public void OnEnable()
    {
        string name = "boss";

        if (characterReader == null)
        {
            characterReader = GameObject.FindObjectOfType <GameManager>().GetComponent <GameManager>().characterReader;
        }
        skilldata   = characterReader.GetMonsterSkillUI(name);
        description = characterReader.GetCharacterDescription(PawnType.Monster, name);

        //txtname.text="Andre";
        string skilltext = "";

        for (int i = 0; i < 5; 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 = "<size=22>" + skilltext + "</size>";
        story.text = "<size=22>" + description.story + "</size>";
        race.text  = description.race;
        story.text = description.story;
        desc.text  = description.description;
        index      = 0;
        UpdateImage();
    }
Example #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;
        }
    }
Example #3
0
    public void UpdateCurrentMonster()
    {
        if (characterReader == null)
        {
            characterReader = GameObject.FindObjectOfType <GameManager>().GetComponent <GameManager>().characterReader;
        }
        string name = type.ToString();

        skilldata   = characterReader.GetMonsterSkillUI(name);
        description = characterReader.GetCharacterDescription(PawnType.Monster, name);

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

        for (int i = 0; i < 5; 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;
        race.text  = description.race;
        story.text = description.story;
        desc.text  = description.description;

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