Beispiel #1
0
        private static bool ActionCheck(ComboAction chall, PlayerID plyrID)
        {
            bool returnVal = false;

            InputType inpType = GetComboActionType(chall);

            switch (inpType)
            {
            case InputType.AXIS:
                AxisAction a         = (AxisAction)chall;
                float      someFloat = Input.GetAxis(a.axisID, plyrID);

                if (Challenges.Axis(someFloat, a.challengeID))
                {
                    returnVal = true;
                }
                break;

            case InputType.BUTTON:
                ButtonAction b        = (ButtonAction)chall;
                bool         someBool = Input.GetButtonDown(b.buttonID, plyrID);

                if (Challenges.Button(someBool, b.challengeID))
                {
                    returnVal = true;
                }
                break;
            }
            return(returnVal);
        }
        // Creates the moves that the Combo system will use
        public void IntializeCombos() {
            comboNames = new string[moveDef.Length];
            int comboCount = 0;

            // Loop through the moves
            for (int i = 0; i < moveDef.Length; i++) {

                ComboAction[] challSequence = new ComboAction[moveDef[i].comboDef.Length];
                // loop through sequence
                for (int j = 0; j < moveDef[i].comboDef.Length; j++) {

                    // Test to see what typ of combo it is (AXIS or BUTTON)
                    switch (moveDef[i].comboDef[j].inptType) {

                        case InputType.AXIS: // Its a axis type
                            challSequence[j] = CreateAxisAction(ref moveDef[i].comboDef[j]);

                            break;
                        case InputType.BUTTON: // Its a button type
                            challSequence[j] = CreateButtonAction(ref moveDef[i].comboDef[j]);

                            break;
                    }
                }
                comboCount += 1;
                // The created Move that can be added to the dictonary
                Move moveRev = new Move(moveDef[i].name, challSequence);

                comboNames[i] = moveRev.name;

                Combo.AddCombo(moveRev);
            }
        }
Beispiel #3
0
        // Creates the moves that the Combo system will use
        public void IntializeCombos()
        {
            comboNames = new string[moveDef.Length];
            int comboCount = 0;

            // Loop through the moves
            for (int i = 0; i < moveDef.Length; i++)
            {
                ComboAction[] challSequence = new ComboAction[moveDef[i].comboDef.Length];
                // loop through sequence
                for (int j = 0; j < moveDef[i].comboDef.Length; j++)
                {
                    // Test to see what typ of combo it is (AXIS or BUTTON)
                    switch (moveDef[i].comboDef[j].inptType)
                    {
                    case InputType.AXIS:     // Its a axis type
                        challSequence[j] = CreateAxisAction(ref moveDef[i].comboDef[j]);

                        break;

                    case InputType.BUTTON:     // Its a button type
                        challSequence[j] = CreateButtonAction(ref moveDef[i].comboDef[j]);

                        break;
                    }
                }
                comboCount += 1;
                // The created Move that can be added to the dictonary
                Move moveRev = new Move(moveDef[i].name, challSequence);

                comboNames[i] = moveRev.name;

                Combo.AddCombo(moveRev);
            }
        }
Beispiel #4
0
 private static InputType GetComboActionType(ComboAction chall)
 {
     if (chall.GetType() == typeof(ButtonAction))
     {
         return(InputType.BUTTON);
     }
     else if (chall.GetType() == typeof(AxisAction))
     {
         return(InputType.AXIS);
     }
     else
     {
         Debug.LogError("InputType is invalid (must be axis or button)");
         return(InputType.NONE);
     }
 }
Beispiel #5
0
        private static bool ActionCheck(ComboAction chall, PlayerID plyrID) {
            bool returnVal = false;

            InputType inpType = GetComboActionType(chall);
            switch (inpType) {
                case InputType.AXIS:
                    AxisAction a = (AxisAction)chall;
                    float someFloat = Input.GetAxis(a.axisID, plyrID);

                    if (Challenges.Axis(someFloat, a.challengeID)) { returnVal = true; }
                    break;

                case InputType.BUTTON:
                    ButtonAction b = (ButtonAction)chall;
                    bool someBool = Input.GetButtonDown(b.buttonID, plyrID);

                    if (Challenges.Button(someBool, b.challengeID)) { returnVal = true; }
                    break;
            }
            return returnVal;
        }
Beispiel #6
0
        private static InputType GetComboActionType(ComboAction chall) {

            if (chall.GetType() == typeof(ButtonAction)) {
                return InputType.BUTTON;
            } else if (chall.GetType() == typeof(AxisAction)) {
                return InputType.AXIS;
            } else {
                Debug.LogError("InputType is invalid (must be axis or button)");
                return InputType.NONE;
            }
        }
Beispiel #7
0
 public Move(string nm, ComboAction[] seq) {
     name = nm;
     sequence = seq;
 }