private void PollForButtonInput() { if (Input.GetButtonDown("Start")) { //TODO: this is where we can go to reset the game or maybe even close it out and go back to the app selection screen } if (Input.GetKeyDown(JoystickButtonMaps.left.ToString()) || Input.GetKeyDown(JoystickButtonMaps.a.ToString())) { //TODO: set up the move cursor to the left print("BACK"); circuitGridControlScript.MoveCursor(JoystickButtonMaps.left); } if (Input.GetKeyDown(JoystickButtonMaps.right.ToString()) || Input.GetKeyDown(JoystickButtonMaps.d.ToString())) { //TODO: setup the move cursor to the right print("FORWARD"); circuitGridControlScript.MoveCursor(JoystickButtonMaps.right); } ArcadeButtonGates gateButtonPressed = arcadeButtonInput.isButtonPressed(); if (gateButtonPressed != ArcadeButtonGates.None) { // print("what is gate buton " + gateButtonPressed); PressedGate(gateButtonPressed); } if (Input.GetKey("escape")) { Application.Quit(); } }
private void PollForButtonInput() { if (Input.GetButtonDown("Start")) { //the game or maybe even close it out and go back to the app selection screen startButtonPressCount = Time.time; print("Start button press " + startButtonPressCount); } if (Input.GetButtonDown("Menu")) { print("QUIT APP!!"); System.Diagnostics.Process.Start("osascript", "-e 'tell application \"Quantum Arcade\" to activate'"); Application.Quit(); } if (Input.GetKeyDown(JoystickButtonMaps.left.ToString()) || Input.GetKeyDown(JoystickButtonMaps.a.ToString())) { //TODO: set up the move cursor to the left //print("BACK"); circuitGridControlScript.MoveCursor(JoystickButtonMaps.left); } if (Input.GetKeyDown(JoystickButtonMaps.right.ToString()) || Input.GetKeyDown(JoystickButtonMaps.d.ToString())) { //TODO: setup the move cursor to the right //print("FORWARD"); circuitGridControlScript.MoveCursor(JoystickButtonMaps.right); } ArcadeButtonGates gateButtonPressed = arcadeButtonInput.isButtonPressed(); if (gateButtonPressed != ArcadeButtonGates.None) { // print("what is gate buton " + gateButtonPressed); PressedGate(gateButtonPressed); } if (Input.GetButtonUp("Start")) { startButtonPressCount = Math.Abs(Time.time - startButtonPressCount); print("time down " + startButtonPressCount); if (startButtonPressCount >= 3.0f) { print("QUIT APP!!"); startButtonPressCount = 0f; System.Diagnostics.Process.Start("osascript", "-e 'tell application \"AppMenu\" to activate'"); Application.Quit(); } startButtonPressCount = 0f; } if (Input.GetKey("escape")) { Application.Quit(); } }