示例#1
0
 private void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.CompareTag("Player"))
     {
         //Debug.Log("Collided with Player Tag");
         boyHealth.TakeDamage(1);
         Destroy(gameObject);
     }
     if (col.gameObject.CompareTag("Enemy") && bookInFlight)
     {
         Destroy(gameObject);
     }
 }
示例#2
0
    private void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.CompareTag("Peeled Banana"))
        {
            if (!stunned)
            {
                StartCoroutine(Stun(4));
                Instantiate(stunParticle, transform.TransformPoint(0f, 1.4f, 0f), Quaternion.Euler(90f, 0f, 0f));
                Destroy(col.gameObject);
            }
        }

        if (col.gameObject.CompareTag("Player"))
        {
            //Debug.Log("Collided with Player Tag");
            boyHealth.TakeDamage(1);
        }
    }