using TMPro; using UnityEngine; using UnityEngine.UI; public class MissionSetup : MonoBehaviour { private TextMeshProUGUI missionName; private TextMeshProUGUI missionDesc; private TextMeshProUGUI factionName; private Image factionImage; private TextMeshProUGUI difficulty; private TextMeshProUGUI rewards1; private TextMeshProUGUI rewards2; public void SetMissionInfo(string missionNameGiven, string missionDescGiven, string factionNameGiven, Sprite factionImageGiven, string difficultyGiven, int rewards1Given, int rewards2Given) { missionName = transform.Find("Mission Title").GetComponent<TextMeshProUGUI>(); missionDesc = transform.Find("Mission Description").GetComponent<TextMeshProUGUI>(); factionName = transform.Find("Faction Title").GetComponent<TextMeshProUGUI>(); factionImage = transform.Find("Faction Image").GetComponent<Image>(); difficulty = transform.Find("Difficulty").GetComponent<TextMeshProUGUI>(); rewards1 = transform.Find("Reward #").GetComponent<TextMeshProUGUI>(); rewards2 = transform.Find("Reward # 1").GetComponent<TextMeshProUGUI>(); missionName.text = missionNameGiven; missionDesc.text = missionDescGiven; factionName.text = factionNameGiven; factionImage.sprite = factionImageGiven; difficulty.text = difficultyGiven; rewards1.text = rewards1Given.ToString(); rewards2.text = rewards2Given.ToString(); } public string GetMissionName() { return missionName.text; } public string GetMissionDesc() { return missionDesc.text; } public string GetFactionName() { return factionName.text; } public string GetDifficulty() { return difficulty.text; } public int GetReward1() { return int.Parse(rewards1.text); } public int GetReward2() { return int.Parse(rewards2.text); } }