Beispiel #1
0
    public void SetValues(GameObject skillDisplayObj, PlayerStats Player)
    {
        // This is how we initialize the UI text
        if (skillDisplayObj)
        {
            SkillsDisplay sd = skillDisplayObj.GetComponent <SkillsDisplay>();
            sd.skillName.text = name;

            if (sd.skilLDescription)
            {
                sd.skilLDescription.text = Description;
            }

            if (sd.skillIcon)
            {
                sd.skillIcon.sprite = icon;
            }

            if (sd.skillLev)
            {
                sd.skillLev.text = LevelNeeded.ToString();
            }

            if (sd.XPNeeded)
            {
                sd.XPNeeded.text = XPNeeded.ToString();
            }

            if (sd.skillAttribute)
            {
                sd.skillAttribute.text = AffectedAttributes[0].attribute.ToString();
            }

            if (sd.skillAttrAmount)
            {
                sd.skillAttrAmount.text = "+" + AffectedAttributes[0].amount.ToString();
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     audioSource = GetComponent<AudioSource>();
     dude = GetComponent<Dude>();
     powerupsDisplay = dude.FindPowerupsDisplay(name);
     skillsDisplay = dude.FindSkillsDisplay(name);
 }