public void HandleActionInput(CharActionInput actionInput)
    {
        string s = actionInput.ToString();


        animator.SetTrigger(s);
        Debug.Log(s);
    }
예제 #2
0
    public void ReadInput()
    {
        InputDirectionX = Input.GetAxisRaw("Horizontal" + playerNumber);

        if (Input.GetKeyDown(KeyCode.Z))//jump or air jump
        {
            CharActionInput input = CharActionInput.Jump;
            actionInputs.Add(input);
        }


        if (Input.GetKeyDown(KeyCode.X))//normal attacks
        {
            CharActionInput input = CharActionInput.NeutralAttack;
            if (Input.GetAxisRaw("Vertical" + playerNumber) > 0)//up
            {
                input = CharActionInput.UpAttack;
            }
            else if (Input.GetAxisRaw("Vertical" + playerNumber) < 0)//down
            {
                input = CharActionInput.DownAttack;
            }
            else if (Input.GetAxisRaw("Horizontal" + playerNumber) < 0)//left
            {
                input = CharActionInput.LeftAttack;
            }
            else if (Input.GetAxisRaw("Horizontal" + playerNumber) > 0)//right
            {
                input = CharActionInput.RightAttack;
            }

            actionInputs.Add(input);
        }

        if (Input.GetKeyDown(KeyCode.C))//special attacks
        {
            Debug.Log("Disabled special attacks because they aren't finished yet!");

            /*
             * CharActionInput input = CharActionInput.NeutralSpecial;
             * if (Input.GetAxisRaw("Vertical" + playerNumber) > 0)//up
             * {
             *  input = CharActionInput.UpSpecial;
             * }
             * else if (Input.GetAxisRaw("Vertical" + playerNumber) < 0)//down
             * {
             *  input = CharActionInput.DownSpecial;
             * }
             * else if (Input.GetAxisRaw("Horizontal" + playerNumber) < 0)//left
             * {
             *  input = CharActionInput.LeftSpecial;
             * }
             * else if (Input.GetAxisRaw("Horizontal" + playerNumber) > 0)//right
             * {
             *  input = CharActionInput.RightSpecial;
             * }
             *
             * actionInputs.Add(input);
             */
        }

        if (Input.GetKeyDown(KeyCode.V))// EX special attacks
        {
            Debug.Log("Disabled special attacks because they aren't finished yet!");

            /*
             * CharActionInput input = CharActionInput.EXNeutralSpecial;
             * if (Input.GetAxisRaw("Vertical" + playerNumber) > 0)//up
             * {
             *  input = CharActionInput.EXUpSpecial;
             * }
             * else if (Input.GetAxisRaw("Vertical" + playerNumber) < 0)//down
             * {
             *  input = CharActionInput.EXDownSpecial;
             * }
             * else if (Input.GetAxisRaw("Horizontal" + playerNumber) < 0)//left
             * {
             *  input = CharActionInput.EXLeftSpecial;
             * }
             * else if (Input.GetAxisRaw("Horizontal" + playerNumber) > 0)//right
             * {
             *  input = CharActionInput.EXRightSpecial;
             * }
             *
             * actionInputs.Add(input);
             */
        }
    }
예제 #3
0
 private void TellCharAnimations(CharActionInput charActionInput)
 {
     charAnimations.HandleActionInput(charActionInput);
 }