123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using UnityEngine;
- using UnityEngine.UI;
- public class QuestUIData : MonoBehaviour
- {
- [SerializeField]
- private Text title;
- [SerializeField]
- private Text experience;
- [SerializeField]
- private Text motivation;
- [SerializeField]
- private Text dollars;
- [SerializeField]
- private Text glam;
- [SerializeField]
- private Image questStateIcon;
- [SerializeField]
- private Sprite completed;
- [SerializeField]
- private Sprite noCompleted;
- private string id;
- public string Id
- {
- get { return id; }
- }
- public void Setup(DataTools.Quest quest, bool isCompleted = false)
- {
- id = quest.Id;
- title.text = quest.Description;
- experience.text = quest.Reward.Experience.ToString();
- motivation.text = quest.Reward.Motivation.ToString();
- dollars.text = quest.Reward.Dollars.ToString();
- glam.text = quest.Reward.Glam.ToString();
- if(isCompleted)
- Completed();
- }
- public void Completed()
- {
- questStateIcon.sprite = completed;
- }
- }
|