コード例 #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());
 }