void Update() { // If any player holds Button 4 and 5 simultaneously for 5 seconds, the game ends. if (TinderBoxAPI.ControlState(Players.Player1, Controls.Button4) && TinderBoxAPI.ControlState(Players.Player1, Controls.Button5) || TinderBoxAPI.ControlState(Players.Player2, Controls.Button4) && TinderBoxAPI.ControlState(Players.Player2, Controls.Button5) || TinderBoxAPI.ControlState(Players.Player3, Controls.Button4) && TinderBoxAPI.ControlState(Players.Player3, Controls.Button5) || TinderBoxAPI.ControlState(Players.Player4, Controls.Button4) && TinderBoxAPI.ControlState(Players.Player4, Controls.Button5)) { quitTimer += Time.deltaTime; } else { quitTimer = 0; } if (quitTimer > TinderBoxAPI.QuitCommandHoldLength) { Debug.Log("Quitting!"); Application.Quit(); } }
void OnApplicationQuit() { TinderBoxAPI.GameOver(); }
IEnumerator Start() { yield return(new WaitForEndOfFrame()); TinderBoxAPI.IsReady(); }