private void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { PlayCanvas.SetActive(false); EndGameCanvas.SetActive(true); other.GetComponent <PlayerMovementScript>().enabled = false; ScoreText2.text += ScoreText1.text; } }
// Use this for initialization void Start() { Players = GameObject.FindObjectsOfType <Player> (); Tiles = GameObject.FindObjectsOfType <Ground> (); StartCanvas = GameObject.FindGameObjectWithTag("StartScreen"); GameCanvas = GameObject.FindGameObjectWithTag("Game"); GameCanvas.SetActive(false); EndGameCanvas = GameObject.FindGameObjectWithTag("Finish"); EndGameCanvas.SetActive(false); }