Пример #1
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (flight_way < 0)
     {
         return;
     }
     if (collision.collider.tag == "Enemy")
     {
         collision.transform.GetComponent <CEnemy>().SetHurtValue(Player.weapon.attack, flight_way);
         if (test)
         {
             tutorialRequest.DoneHitEnemy();
         }
         flight_way = -1;
         gameObject.SetActive(false);
     }
     else if (collision.collider.tag == "Wall")
     {
         flight_way = -1;
         gameObject.SetActive(false);
     }
 }
Пример #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Enemy" && animation_type == 2)
     {
         if (weapon.ani_type != 0)
         {
             return;
         }
         Debug.Log("atttttack waaaaaaay" + face_way + "   " + gameObject.name);
         Debug.Log("hit enemy");
         collision.transform.GetComponent <CEnemy>().SetHurtValue(weapon.attack, face_way);
         //GameObject.Find("MonsterAudio").GetComponent<MonsterVoice>().SetAudio(0 ,1f);
         if (test)
         {
             tutorialRequest.DoneHitEnemy();
         }
         //collision.transform.GetComponent<CEnemy>().SetState(4, true);
         //attackDetect();
     }
 }