Exemplo n.º 1
0
 void OnCollisionStay(Collision col)
 {
     if (col.gameObject.tag == "Player")
     {
         health = col.gameObject.transform.GetComponent <Player_Health>();
         if (Time.time > lastAttack + 1f)
         {
             health.Attack(5f);
             audio_manager.Source.clip = audio_manager.hit;
             audio_manager.Source.Play();
             lastAttack = Time.time;
         }
     }
 }