using UnityEngine;
using System.Collections;

public class PlayerController:MonoBehaviour
{

    public UnityEngine.UI.Text winText;
    void Start(){
        winText.text = "You Win!";
        winText.gameObject.SetActive (false); //hide winText
    }

   ....
   
    void OnTriggerEnter(Collider other){
        if (other.gameObject.tag == "Coin") {
            other.gameObject.SetActive(false); //hide coin
         winText.gameObject.SetActive(true); //show winText
            
        }

    }

}

相关文章:

  • 2022-12-23
  • 2021-07-21
  • 2021-05-15
  • 2021-09-29
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-29
  • 2022-12-23
  • 2022-03-05
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
相关资源
相似解决方案