// it is being called every time our player hits something private void OnControllerColliderHit(ControllerColliderHit hit) { if (hit.point.z > transform.position.z + controller.radius) { BluetoothTest.SendValue("d"); //ArduinoConnect.SendValue("d"); Death(); } }
// Start is called before the first frame update void Awake() { if (instance == null) { instance = this; } IsConnected = false; BluetoothService.CreateBluetoothObject(); }
// Update is called once per frame void Update() { if (playerTransform.position.z - safeZone > (spawnZ - amnLanesOnScreen * laneLength)) { SpawnLane(); DeleteLane(); } BluetoothTest.SendValue(activeLanes[1].ToString().Substring(0, 1)); //ArduinoConnect.SendValue(activeLanes[1].ToString().Substring(0, 1)); Debug.Log(activeLanes[1].ToString().Substring(0, 1)); }
//public void Restart() //{ // SceneManager.LoadScene(SceneManager.GetActiveScene().name); // //BluetoothTest.RestartConnection(); // //ArduinoConnect.restartPort(); //} public void ToMenu() { BluetoothTest.StopConnection(); SceneManager.LoadScene("Menu"); }