private void Awake() { _enemySpawner = FindObjectOfType <EnemySpawner>(); _shooting = GetComponent <IShooting>(); _rotateToTarget = GetComponent <IRotateToTarget>(); StartCoroutine(ChangeTarget()); }
private void Awake() { rotator = GetComponent <IRotatable> (); shooting = GetComponent <IShooting> (); magazineManager = GetComponent <IWeaponMagazineManager> (); magazineManager.Initialize(stats); shooting.Initialize(stats); }
private void EquipNewGun(BasePlanetGun newGun) { var transformToSpawn = currentGun.transform; Destroy(currentGun.gameObject); currentGun = Instantiate(newGun, transformToSpawn.position, transformToSpawn.rotation); currentGun.transform.SetParent(this.transform); gunComponent = currentGun.GetComponent <IShooting>(); }
private void Awake() { moveComponent = this.GetComponent <IMovable>(); damageComponent = this.GetComponent <IDamageable>(); damageComponent.DeathEvent += OnDied; currentGun = Instantiate(startingPlanetGun, this.transform.position + new Vector3(0, 2, 0), Quaternion.identity); currentGun.transform.SetParent(this.transform); gunComponent = currentGun.GetComponent <IShooting>(); healthComponent = this.GetComponent <ICurable>(); }
public AI(Enemy enemyToControl) { ControllingEnemy = enemyToControl; shooterEnemy = ControllingEnemy as IShooting; shootTimer = 0f; }
public SoldierBase() { running = new SimpleRun(); shooting = new SimpleShoot(); }
public EnemyController(IMove move, IRotation rotation, IShooting shooting) { _move = move; _rotation = rotation; _shooting = shooting; }
//Component should be initialized for using public void Init(IShooting myIShooting) { shootImplementation = myIShooting; }