예제 #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            boat.KnockbackDangers(GetComponent <Collider2D>());
            FindObjectOfType <AudioManager>().requestSoundDelegate(Sounds.CrocodileBite);

            Debug.Log("Hit croc");
        }
    }
예제 #2
0
 private void Hit()
 {
     //Debug.Log("Stone should get destroyed");
     Sound();
     anim.SetBool("Hit", true);
     Destroy(GetComponent <Collider2D>());
     Destroy(gameObject, deleteTimer);
     boat.KnockbackDangers(GetComponent <Collider2D>());
     Debug.Log("Hit stone");
     triggered = false;
 }