コード例 #1
0
 // 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();
     }
 }
コード例 #2
0
    // Start is called before the first frame update
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }

        IsConnected = false;
        BluetoothService.CreateBluetoothObject();
    }
コード例 #3
0
 // 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));
 }
コード例 #4
0
    //public void Restart()
    //{
    //    SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    //    //BluetoothTest.RestartConnection();
    //    //ArduinoConnect.restartPort();
    //}

    public void ToMenu()
    {
        BluetoothTest.StopConnection();
        SceneManager.LoadScene("Menu");
    }