void HandleButtons() { Button button = Button.None; if (Input.GetButtonDown(InputManager.InputString(playerNum, "AButton"))) { button = Button.A; } if (Input.GetButtonDown(InputManager.InputString(playerNum, "BButton"))) { button = Button.B; } if (Input.GetButtonDown(InputManager.InputString(playerNum, "XButton"))) { button = Button.X; } if (Input.GetButtonDown(InputManager.InputString(playerNum, "YButton"))) { button = Button.Y; } if (button != Button.None) { FGInput input = new FGInput(); input.button = button; input.stick = latestStickInput; input.commandInput = Command(); DoInput(input); } }
void AddStickInput() { stickInputTimer = 0; bool tryingToDP = latestStickInput == StickInput.Down && stickInputs.Count >= 2 && (stickInputs[stickInputs.Count - 2] == StickInput.Forward || stickInputs[stickInputs.Count - 2] == StickInput.Back) && (stickInputs[stickInputs.Count - 1] == StickInput.DownForward || stickInputs[stickInputs.Count - 2] == StickInput.DownBack); if (tryingToDP) { List <StickInput> dupeList = new List <StickInput>(); for (int i = 0; i < stickInputs.Count; i++) { dupeList.Add(stickInputs[i]); } stickInputs.Clear(); for (int i = 0; i < dupeList.Count; i++) { if (i < dupeList.Count - 1) { stickInputs.Add(dupeList[i]); } } } stickInputs.Add(latestStickInput); if (Command() == CommandInput.FF || Command() == CommandInput.BB) { FGInput input = new FGInput(); input.button = Button.None; input.stick = StickInput.Neutral; input.commandInput = Command(); DoInput(input); } }
void DoInput(FGInput input) { if (player != null) { player.DoInput(input); } if (visualizer != null) { visualizer.DoInput(input); } }