Example #1
0
        // Called every frame
        protected override void InputUpdate()
        {
            if (hudController != null)
            {
                hudController.SetPrompts("PRESS " + enterExitInput.GetInputAsString() + " TO ENTER",
                                         "PRESS " + enterExitInput.GetInputAsString() + " TO EXIT");
            }

            if (vehicleEnterExitManager.EnterableVehicles.Count > 0)
            {
                // Check for input
                if (enterExitInput.Down())
                {
                    Vehicle parent = vehicleEnterExitManager.EnterableVehicles[0].Vehicle;
                    vehicleEnterExitManager.EnterParent(0);
                    gameAgent.EnterVehicle(parent);
                }
            }
            else if (vehicleEnterExitManager.CanExitToChild())
            {
                // Check for input
                if (enterExitInput.Down())
                {
                    Vehicle child = vehicleEnterExitManager.Child.Vehicle;
                    vehicleEnterExitManager.ExitToChild();
                    gameAgent.EnterVehicle(child);
                }
            }
        }
Example #2
0
        protected override void InputUpdate()
        {
            if (hudShipLander != null)
            {
                hudShipLander.SetPrompts("PRESS " + landingInput.GetInputAsString() + " TO LAUNCH", "PRESS " + landingInput.GetInputAsString() + " TO LAND");
            }

            switch (shipLander.CurrentState)
            {
            case (ShipLander.ShipLanderState.Launched):

                if (landingInput.Down())
                {
                    shipLander.Land();
                }

                break;

            case (ShipLander.ShipLanderState.Landed):

                if (landingInput.Down())
                {
                    shipLander.Launch();
                }

                break;
            }
        }