private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Goal")
     {
         uiControl.EndGame();
     }
 }
示例#2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.CompareTag("Goal"))
     {
         Debug.Log("Level Cleared!");
         UIControl.EndGame("LEVEL CLEAR!", Color.green);
     }
 }
示例#3
0
 public void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Goal")
     {
         Debug.Log("Kena");
         uiController.EndGame();
     }
 }
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Goal"))
     {
         Debug.Log("Level clear");
         Destroy(gameObject);
         uiControl.EndGame();
     }
 }
示例#5
0
 public void EndGame()
 {
     for (int i = 0; i < playersCount; i++)
     {
         players [i].transform.Find("Tank controller").SendMessage("DeactivateHud");
     }
     Time.timeScale = 0.0f;
     uics.EndGame();
 }
示例#6
0
    public void OnTriggerExit2D(Collider2D collision)
    {
        //if (isPulled || isCrashed) return;

        if (collision.gameObject.CompareTag("Goal") && !isCrashed)
        {
            uiControl.EndGame();
        }

        if (collision.gameObject.CompareTag("Tower"))
        {
            closestTower = null;

            //Change tower color back to normal
            collision.gameObject.GetComponent <SpriteRenderer>().color = baseColor;
        }
    }
示例#7
0
 void EndGame()
 {
     GameObject.FindGameObjectWithTag("Level").GetComponent <AudioSource> ().Stop();
     Time.timeScale = 0.0f;
     uics.EndGame();
 }