コード例 #1
0
ファイル: UserInput.cs プロジェクト: soulagent/MyGame
    // Update is called once per frame
    void Update()
    {
        if (characterMove)
        {
            characterMove.Animate(Input.GetAxis("Vertical"), Input.GetAxis("Horizontal"));

            if (Input.GetButtonDown("Jump"))
            {
                //characterMove.Jump();
            }
            if (Input.GetButtonDown("Attack1"))
            {
                attackManager.Attack1();
            }
            if (Input.GetButtonDown("Attack2"))
            {
                attackManager.Attack2();
            }
            if (Input.GetButtonDown("Attack3"))
            {
                attackManager.Attack3();
            }
        }
        if (mainCam)
        {
            if (other.requireInputForTurn)
            {
                if (Input.GetAxis(input.horizontalAxis) != 0 || Input.GetAxis(input.verticalAxis) != 0)
                {
                    CharacterLook();
                }
            }
        }
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        if (characterMove)
        {
            characterMove.Animate(Input.GetAxis("Vertical"), Input.GetAxis("Horizontal"));

            if (Input.GetButtonDown("Jump"))
            {
                characterMove.Jump();
            }
        }
        if (mainCam)
        {
            if (other.requireInputForTurn)
            {
                if (Input.GetAxis(input.horizontalAxis) != 0 || Input.GetAxis(input.verticalAxis) != 0)
                {
                    CharacterLook();
                }
                else
                {
                    CharacterLook();
                }
            }
        }
    }
コード例 #3
0
    //Handles character logic
    void CharacterLogic()
    {
        if (!characterMove)
        {
            return;
        }

        characterMove.Animate(Input.GetAxis(input.verticalAxis), Input.GetAxis(input.horizontalAxis));

        if (Input.GetButtonDown(input.jumpButton))
        {
            characterMove.Jump();
        }
    }