Beispiel #1
0
        public void Execute(float deltaTime)
        {
            _shipMove.Rotation(_playerInput.GetRotation());
            _shipMove.Move(_playerInput.GetMovement(), Time.deltaTime);


            if (_playerInput.GetAcelleration() && !_shipMove.isAccellerated)
            {
                _shipMove.AddAcceleration();
            }
            else if (!_playerInput.GetAcelleration() && _shipMove.isAccellerated)
            {
                _shipMove.RemoveAcceleration();
            }
        }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        //Store player input, defaults to 0.0f to lock out controls if needed
        float hardBank   = 0.0f;
        float horizontal = 0.0f;
        float vertical   = 0.0f;

        //Get Bank, X and Y input
        hardBank   = Input.GetAxis("HardBank");
        horizontal = Input.GetAxis("Horizontal");
        vertical   = Input.GetAxis("Vertical");


        //Execute movement
        move.Move(!roll.IsRolling, horizontal, vertical, hardBank);



        //Execute rotation
        rotate.Rotate(vertical, horizontal, move.invert);

        //Execute banking
        bank.Bank(hardBank, horizontal, wings[0].wingDestroyed, wings[1].wingDestroyed, roll.IsRolling);



        //Execute forward boosting/braking
        boost.Boost(Input.GetAxis("BoostAndBrake"));
        boost.Brake(Input.GetAxis("BoostAndBrake"));

        //Execute rolling
        roll.Roll(Input.GetAxis("Roll"));


        //Execute camera banking
        cameraBank.Bank(hardBank, horizontal);

        //Execute camera panning
        cameraPan.Pan(transform.localPosition.x, transform.localPosition.y);
    }