コード例 #1
0
        public void SetInfo(BaseMerchant merchant)
        {
            merchantAvatar.sprite = merchant.GetComponent <Image>().sprite;
            merchantName.text     = merchant.Name;
            passiveSkillName.text = merchant.PassiveSkill != null
                ? merchant.PassiveSkill.Name + " (passive)"
                : "";
            passiveSkillDesc.text = merchant.PassiveSkill != null
                ? merchant.PassiveSkill.Description
                : "";
            passiveSkillAvatar.sprite = merchant.PassiveSkill != null
                ? merchant.PassiveSkill.GetComponent <SpriteRenderer>().sprite
                : null;

            activeSkillName.text = merchant.Skill != null
                ? merchant.Skill.Name + $" ({merchant.Skill.ManaCost} mana)"
                : "";
            activeSkillDesc.text = merchant.Skill != null
                ? merchant.Skill.Description
                : "";
            activeSkillAvatar.sprite = merchant.Skill != null
                ? merchant.Skill.GetComponent <Image>().sprite
                : null;
        }
コード例 #2
0
 public void SetInfo(BaseMerchant merchant)
 {
     merchantAvatar.sprite = merchant.GetComponent <Image>().sprite;
 }