コード例 #1
0
 private void Awake()
 {
     _enemySpawner   = FindObjectOfType <EnemySpawner>();
     _shooting       = GetComponent <IShooting>();
     _rotateToTarget = GetComponent <IRotateToTarget>();
     StartCoroutine(ChangeTarget());
 }
コード例 #2
0
 private void Awake()
 {
     rotator         = GetComponent <IRotatable> ();
     shooting        = GetComponent <IShooting> ();
     magazineManager = GetComponent <IWeaponMagazineManager> ();
     magazineManager.Initialize(stats);
     shooting.Initialize(stats);
 }
コード例 #3
0
        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>();
        }
コード例 #4
0
 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>();
 }
コード例 #5
0
 public AI(Enemy enemyToControl)
 {
     ControllingEnemy = enemyToControl;
     shooterEnemy     = ControllingEnemy as IShooting;
     shootTimer       = 0f;
 }
コード例 #6
0
 public SoldierBase()
 {
     running  = new SimpleRun();
     shooting = new SimpleShoot();
 }
コード例 #7
0
 public EnemyController(IMove move, IRotation rotation, IShooting shooting)
 {
     _move     = move;
     _rotation = rotation;
     _shooting = shooting;
 }
コード例 #8
0
 //Component should be initialized for using
 public void Init(IShooting myIShooting)
 {
     shootImplementation = myIShooting;
 }