示例#1
0
 protected override void Movement()
 {
     if (laserFired)
     {
         if (holdLaser)
         {
             if (!laser.IsLaserCharging())
             {
                 transform.eulerAngles = holdPosition;
             }
             else
             {
                 if (targetLocation)
                 {
                     targetZ = Quaternion.LookRotation(Vector3.forward, (-(Player.instance.transform.position - transform.position))).eulerAngles.z;
                 }
                 else
                 {
                     startZ         = transform.eulerAngles.z;
                     targetZ        = Quaternion.LookRotation(Vector3.forward, (-(Player.instance.transform.position - transform.position))).eulerAngles.z;
                     targetLocation = true;
                     zTime          = 0.0f;
                     StartCoroutine(MoveToTarget());
                 }
             }
         }
         if (!laser.IsLaserFiring())
         {
             if (repeatingLaser && repeating != 0)
             {
                 --repeating;
                 laser.SetParameters(1.0f, 0.1f, 2.0f);
                 laser.FireLaser();
             }
             else
             {
                 repeatingLaser = false;
                 patternActive  = false;
                 laserFired     = false;
                 randomMovement = true;
                 holdLaser      = false;
             }
         }
     }
     if (randomMovement)
     {
         if (!targetLocation)
         {
             zSpeed         = 1.0f;
             startZ         = transform.eulerAngles.z;
             targetZ        = Random.Range(minZ, maxZ);
             targetLocation = true;
             zTime          = 0.0f;
             StartCoroutine(MoveToTarget());
         }
     }
 }
示例#2
0
 protected override void TriggerBehavior()
 {
     base.TriggerBehavior();
     laser.SetParameters(chargeLaser[currentTier], durationLaser[currentTier], damageLaser[currentTier]);
     laser.FireLaser();
     cannonMove = 0.0f;
 }