Beispiel #1
0
 protected override void Init()
 {
     target = PlayerMovement.Instance.transform;
     if (gunNr == -1)
     {
         gun = GunContainer.GetRandomGun();
     }
     else
     {
         gun = GunContainer.GetGun(gunNr);
     }
     bias        = new Vector2(Random.Range(-1f, 1f), Random.Range(-1f, 1f)) * biasStrength;
     readyToFire = false;
     Invoke(nameof(FireCooldown), gun.GetFireRate() * GetFirerateMultiplier());
     health += Game.Instance.GetEnemyHealth();
     GenerateDungeon.Instance.objects.Add(gameObject);
 }
Beispiel #2
0
 private void Start()
 {
     gun = GunContainer.GetGun(gunNr);
 }