Esempio n. 1
0
    /// <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();
    }
Esempio n. 2
0
 private void Start()
 {
     RewardUIItem = Resources.Load <RewardUIItem>("UI/Reward");
     player       = GameObject.FindWithTag("Player").transform.GetComponent <Player>();
 }