Esempio n. 1
0
        InputData GetP2InputData()
        {
            if (isReplayingLastRoundInput)
            {
                return(lastRoundP2Input[currentReplayingInputIndex]);
            }

            var time = Time.fixedTime - roundStartTime;

            InputData p2Input = new InputData();

            if (battleAI != null)
            {
                p2Input.input |= battleAI.getNextAIInput();
            }
            else
            {
                p2Input.input |= InputManager.Instance.GetButton(InputManager.Command.p2Left) ? (int)InputDefine.Left : 0;
                p2Input.input |= InputManager.Instance.GetButton(InputManager.Command.p2Right) ? (int)InputDefine.Right : 0;
                p2Input.input |= InputManager.Instance.GetButton(InputManager.Command.p2Attack) ? (int)InputDefine.Attack : 0;
            }

            p2Input.time = time;

            if (debugP2Attack)
            {
                p2Input.input |= (int)InputDefine.Attack;
            }
            if (debugP2Guard)
            {
                p2Input.input |= (int)InputDefine.Right;
            }

            return(p2Input);
        }