TryMove() public method

public TryMove ( float speed ) : void
speed float
return void
Ejemplo n.º 1
0
        void Update()
        {
            if (model == null)
            {
                return;
            }

            float currentHorizontal = Input.GetAxisRaw(horizontalAxis);

            model.TryMove(currentHorizontal);

            if (Input.GetButton(attackButton))
            {
                model.TryShoot();
            }

            if (Input.GetButtonDown(aimButton))
            {
                model.StartAim();
            }
            if (Input.GetButtonUp(aimButton))
            {
                model.StopAim();
            }

            if (Input.GetButtonDown(jumpButton))
            {
                model.TryJump();
            }
        }
Ejemplo n.º 2
0
        void Update()
        {
            if (model == null)
            {
                return;
            }

            float currentHorizontal = UnityEngine.Input.GetAxisRaw(horizontalAxis);

            model.TryMove(currentHorizontal);

            if (UnityEngine.Input.GetButton(attackButton))
            {
                model.TryShoot();
            }

            if (UnityEngine.Input.GetButtonDown(jumpButton))
            {
                model.TryJump();
            }
        }