Ejemplo n.º 1
0
    protected override void Update()
    {
        if (target)
        {
            HandleOrbital(target);

            Vector3 distance = target.position - transform.position;
            if (distance.magnitude <= orbitalRadius)
            {
                transform.rotation = Quaternion.RotateTowards(transform.rotation, Quaternion.LookRotation(distance.normalized, Vector3.up), rotationPerSecond);
                if (Vector3.Dot(distance.normalized, transform.forward) >= 0.95)
                {
                    firingController.Fire(cannonMouth, projectileAsset);
                }
            }
        }
        else
        {
            HandleOrbital(manager.transform);
        }
    }
Ejemplo n.º 2
0
 void f_FiringControlReady(FiringController sender, FiringControllerReadyArgs args)
 {
     sender.VirtualSafetyOn = false;
     sender.Fire(500);
     isFiring = sender.IsFiring();
 }
Ejemplo n.º 3
0
 public override void FireRightBroadside()
 {
     secondaryFiringController.Fire(rightCannonMouths, secondaryProjectileAsset);
 }