/// <summary> /// 激活奖励面板 /// </summary> public void InsRewardUI() { int Count = Random.Range(10, 50); isRewarUIOpen = true; PlayerUICoinPenal.gameObject.SetActive(true); RewardUIItem rewardUIItem = Instantiate(RewardUIItem); rewardUIItem.transform.SetParent(PlayerUICoinPenal); rewardUIItem.coins = Count; rewardUIItem.transform.Find("Text").GetComponent <Text>().text = Count.ToString(); }
private void Start() { RewardUIItem = Resources.Load <RewardUIItem>("UI/Reward"); player = GameObject.FindWithTag("Player").transform.GetComponent <Player>(); }