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();
            }
        }
    }
Esempio n. 2
0
    void FixedUpdate()
    {
        if (path != null && path.Length > 0)
        {
            mControl.MoveTo(path[path_index]);
        }
        else
        {
            mControl.Idle();
        }

        if (moveDirection.y > 0)
        {
            mControl.Jump();
        }
    }