Exemplo n.º 1
0
 private IEnumerator SquareFormationPatrol()
 {
     if (_currentState == GenericShipAiState.SquarePatrolling)
     {
         // Get random forward position and set it as destination.
         _forwardSquarePatrolPoint = GetRandomForwardPosition();
         model.SetDestinationInput(_forwardSquarePatrolPoint);
         while (transform.position != _forwardSquarePatrolPoint)
         {
             yield return(new WaitForSeconds(_behaviorChangeRate));
         }
     }
 }
Exemplo n.º 2
0
        protected virtual void SendInput()
        {
            // Set keyboard mode
            myShip.SetKeyboardMovement(UseKeyboard);

            // Enable if you want the ship to fly toward the mouse cursor position
            myShip.SetDestinationInput(mouseInput);
            myShip.SetKeyboardDestinationInput(keyboardInput);

            myShip.SetRotationInput(mouseInput);
            myShip.SetFireInput(Fire1);
            myShip.SetSecondaryInput(Fire2);
        }