Exemplo n.º 1
0
 public override void TakeDamage(int damage)
 {
     health--;
     if (health <= 0)
     {
         if (gunType == GunsConstants.BossGunType())
         {
             GameManager.instance.AddBonusPoints();
             GameManager.instance.FinishGame();
         }
         else
         {
             Die();
             GameManager.instance.AddScore();
         }
     }
 }
Exemplo n.º 2
0
 private void LoadGunController()
 {
     gunController = carriedGun.GetComponent <GunController>();
     if (gunType == GunsConstants.SubmachinegunGunType())
     {
         health = 2;
         gunController.MediumEnemyGun();
     }
     else if (gunType == GunsConstants.MachinegunGunType())
     {
         health = 3;
         gunController.SuperEnemyGun();
     }
     else if (gunType == GunsConstants.BossGunType())
     {
         health = 6;
         gunController.SuperEnemyGun();
     }
     else
     {
         health = 1;
         gunController.BasicEnemyGun();
     }
 }
Exemplo n.º 3
0
    public void SpawnGun(int gunType, Vector3 position)
    {
        int type = gunType == GunsConstants.BossGunType() ? GunsConstants.MachinegunGunType() : gunType;

        Instantiate(guns[type], position, Quaternion.Euler(new Vector3(0, 90, 0)));
    }