private void AttackTarget(GameObject enemy) { // While facing the enemy, shoot. if (IsFacingTarget(enemy)) { model.SetFireInput(true); } if (!IsFacingTarget(enemy)) { model.SetFireInput(false); } }
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); }