Beispiel #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("SoftObject"))
     {
         OnHit();
     }
     else if (other.CompareTag("HardObject"))
     {
         OnHit();
         SoundManager.instance.PlayEfx(Efx.HIT_HARD, transform.position);
     }
     else if (other.CompareTag("AirWall"))
     {
         if (AirWall.isBulletBlocked)
         {
             OnHit();
             SoundManager.instance.PlayEfx(Efx.HIT_HARD, transform.position);
         }
     }
     else if (other.CompareTag("Wingman"))
     {
         Wingman wingman = other.GetComponent <Wingman>();
         if (wingman != null)
         {
             wingman.Damage();
         }
         OnHit();
     }
     else if (other.CompareTag("PlayerCore"))
     {
         Player.instance.Damage();
         OnHit();
     }
 }
Beispiel #2
0
    public void SetWingmen(int count)
    {
        float delta = 2f * Mathf.PI / count;

        for (int i = 0; i < count; i++)
        {
            Wingman wingman = Instantiate(wingmanPrefab, transform);
            wingman.SetStartPhase(delta * i);
            wingmen.Add(wingman);
        }
    }