예제 #1
0
 private void InitializeComponents()
 {
     mover       = GetComponent <RootMover>();
     hitStimulus = transform.parent.GetComponentInChildren <HitStimulus>();
     _target     = GameObject.FindWithTag(Tags.GameController).GetComponent <Target>();
     player      = GameObject.FindWithTag(Tags.Player).gameObject;
 }
예제 #2
0
        private void InitialzeComponent()
        {
            mover       = GetComponent <RootMover>();
            destroyer   = GetComponent <RootDestroyer>();
            hitStimulus = transform.root.GetComponentInChildren <HitStimulus>();

            timeSinceSpawnedInSeconds = 0;
        }
예제 #3
0
 public virtual void Shoot(EnnemyController shooter)
 {
     if (CanShoot)
     {
         GameObject  bullet      = Instantiate(bulletPrefab, transform.position, transform.rotation);
         HitStimulus hitStimulus = bullet.GetComponentInChildren <HitStimulus>();
         hitStimulus.HitPoints  += damageModifier;
         hitStimulus.ShooterName = shooter.transform.root.name;
         lastTimeShotInSeconds   = Time.time;
     }
 }
예제 #4
0
 public override void Shoot(EnnemyController ennemyController)
 {
     if (CanShoot)
     {
         for (int i = 0; i < nbBullets; ++i)
         {
             GameObject  bullet      = Instantiate(bulletPrefab, transform.position, transform.rotation);
             HitStimulus hitStimulus = bullet.GetComponentInChildren <HitStimulus>();
             hitStimulus.HitPoints  += damageModifier;
             hitStimulus.ShooterName = ennemyController.transform.root.name;
             bullet.transform.Rotate(new Vector3(0, 0, angleEntreBalles * i - (angle / 2)));
         }
         lastTimeShotInSeconds = Time.time;
     }
 }