예제 #1
0
 //gets the players position, or future position
 private Vector3 getPlayerPosition()
 {
     if (predictive)
     {
         return(playerMovement.getFuturePosition());
     }
     else
     {
         return(player.transform.position);
     }
 }
예제 #2
0
 //controls the attack
 void Update()
 {
     if (!bossController.IsDead() && Time.time < attackEndTime)
     {
         transform.LookAt(player.getFuturePosition());
         if (Time.time > nextFire)
         {
             CastProjectile(Random.Range(0, castPoints.Length));
             nextFire += fireRate;
         }
     }
 }
예제 #3
0
 //controls the attack
 void Update()
 {
     if (!bossController.IsDead() && Time.time < attackEndTime)
     {
         transform.LookAt(player.getFuturePosition());
         if (Time.time > nextFire)
         {
             StartCoroutine(Cast());
             nextFire += fireRate;
         }
     }
 }
예제 #4
0
 //Casts the attack
 public void OnCast()
 {
     attackEndTime = Time.time + castDuration;
     nextFire      = Time.time;
     transform.LookAt(player.getFuturePosition());
 }