Exemplo n.º 1
0
 public PlayerDataTextWriter(TextMesh h, TextMesh c, TextMesh l, TextMesh r, TextMesh ff, List <XmlNode> cb, XmlNode top, GameObject ch, GameObject gb, PersistData p)
 {
     headerText         = h;
     infoPaneTextCenter = c;
     infoPaneTextLeft   = l;
     infoPaneTextRight  = r;
     infoPaneFunFact    = ff;
     sd            = p.GetSaveData();
     characterBios = cb;
     characters    = ch;
     goBack        = gb;
     goBack.SetActive(false);
     navDetails = top;
     charSheet  = Resources.LoadAll <Sprite>(SpritePaths.CharFullShots);
     PD         = p;
     bounds     = new Vector2(2.4f, 3.0f);
 }
Exemplo n.º 2
0
    public void LoadCharacterBio(int charIdx, PersistData pers)
    {
        XmlNode bio = characterBios[charIdx];

        headerText.text = bio.Attributes["name"].InnerText;
        int    actIdx = int.Parse(bio.Attributes["idx"].InnerText);
        string res    = "";

        if (actIdx < 0)
        {
            res = bio.SelectSingleNode("bio").InnerText;
            characters.SetActive(false);
        }
        else
        {
            characters.SetActive(true);
            int displayIdx = actIdx >= 10 ? (actIdx + 20) : (actIdx * 3 + Random.Range(0, 1 + pers.GetSaveData().getPlayerWinType(pers.GetPlayerSpritePathFromInt(actIdx))));
            characters.GetComponent <SpriteRenderer>().sprite = charSheet[displayIdx];
            res  = GetXmlValue("age") + ": " + bio.SelectSingleNode("age").InnerText;
            res += "\n\n" + GetXmlValue("likes") + ": " + bio.SelectSingleNode("likes").InnerText;
            res += "\n\n" + GetXmlValue("dislikes") + ": " + bio.SelectSingleNode("dislikes").InnerText;
            res += "\n\n" + bio.SelectSingleNode("bio").InnerText;
        }
        infoPaneTextRight.text = res;
        infoPaneTextRight.text = GetWrappedString(infoPaneTextRight, res, bounds);
    }