Beispiel #1
0
 void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         Debug.Log("Hit player");
         respawn.Reload();
     }
 }
Beispiel #2
0
 // Update is called once per frame
 void Update()
 {
     countdownText.text = ("Time Left = " + timeLeft);
     if (timeLeft <= 0)
     {
         StopCoroutine("LoseTime");
         respawn.Reload();
     }
 }
Beispiel #3
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            Debug.Log("Hit player");
            respawn.Reload();
        }

        if (collision.gameObject.tag == "environment")
        {
            a      = TriggerZone.GetComponent <TriggerFall>();
            a.fall = 2;
            Destroy(gameObject);
        }
    }
Beispiel #4
0
 void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "enemy")
     {
         Destroy(collision.gameObject);
     }
     else if (collision.gameObject.tag == "Player")
     {
         respawn.Reload();
     }
     else if (collision.gameObject.tag == "environment")
     {
         Destroy(gameObject);
     }
 }
Beispiel #5
0
 void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "enemy")
     {
         Destroy(collision.gameObject);
     }
     else if (collision.gameObject.tag == "Player")
     {
         respawn.Reload();
     }
     else if (collision.gameObject.tag == "environment")
     {
         // Destroy(collision.gameObject);
     }
     else if (collision.gameObject.tag == "CrushBlock")
     {
         transform.Translate(Vector3.down * Time.deltaTime * slowSpeed);
         count = slowingTime;
     }
 }