void Update() { if (server == null) { var go = GameObject.Find ("TaiChi_Server"); if (go != null) { server = go.GetComponent<TaiChiServer> (); server.loading = true; } return; } if (isServer) { ingameGUI.SetActive (false); if (server.beamHealth == 0) { print ("got gameovered"); RpcGameover (); } } else { CmdUpdateInputs (Input.gyro.rotationRateUnbiased.y, Input.gyro.rotationRateUnbiased.z, Input.touchCount); if (Input.gyro.rotationRateUnbiased.y > Input.gyro.rotationRateUnbiased.z) { sprite.color = Color.yellow; } else { sprite.color = Color.magenta; } if (server.gameover) { txtScreen.text = ""; sprite.color = Color.red; if (Input.touchCount >= 2) { CmdEndGame (); Application.LoadLevel (Application.loadedLevel); } } } }
void Start() { Input.gyro.enabled = true; Screen.sleepTimeout = SleepTimeout.NeverSleep; server = null; }