示例#1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         PlayerDeath.DeathBy(this);
     }
     else if (other.tag == "Snake")
     {
         return;
     }
 }
示例#2
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "Player")
     {
         PlayerDeath.DeathBy(this);
     }
     else if (other.tag == "Car")
     {
         transform.Rotate(0f, 0f, Random.Range(-30, 30));
     }
 }
示例#3
0
文件: Croc.cs 项目: DDB9/GDEVRetro
    IEnumerator OnTriggerStay2D(Collider2D other)
    {
        if (other.tag == "WaterTile")
        {
            other.enabled = false;
            yield return(new WaitForSeconds(1f));

            other.enabled = true;
        }
        if (other.tag == "Player")
        {
            PlayerDeath.DeathBy(this);
        }
    }