Esempio n. 1
0
    void FixedUpdate()
    {
        if (mControl != null)
        {
            if (CrossPlatformInputManager.GetButton("Left") || Input.GetKey(moveLeft))
            {
                mControl.MoveLeft();
            }
            else if (CrossPlatformInputManager.GetButton("Right") || Input.GetKey(moveRight))
            {
                mControl.MoveRight();
            }
            else
            {
                mControl.Idle();
            }

            if (CrossPlatformInputManager.GetButton("Jump") || Input.GetKey(jump))
            {
                mControl.Jump();
            }

            if (CrossPlatformInputManager.GetButton("Shoot") || Input.GetKey(shoot))
            {
                mControl.Shoot();
            }
        }
    }