private void OnDeviceRemoved(object sender, System.EventArgs e)
        {
            DeviceInterface.StatusUpdate  -= OnStatusUpdate;
            DeviceInterface.DeviceRemoved -= OnDeviceRemoved;

            Disconneted?.Invoke(this, null);
        }
示例#2
0
    IEnumerator CheckConnect()
    {
        yield return(new WaitForSeconds(10f));

        if (ServerConnection == null)
        {
            Disconneted?.Invoke();
            SceneManager.sceneLoaded -= SceneManager_sceneLoaded;
            SceneManager.LoadSceneAsync("Main", LoadSceneMode.Single);
        }
        else
        {
            StartCoroutine("CheckConnect");
        }
    }
示例#3
0
 private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
 {
     if (arg0.name == map)
     {
         mapCam       = GameObject.Find("Map Camera").transform;
         parentForObj = GameObject.Find("InstansesEmpty").transform;
         mpPrefs      = mapCam.GetComponent <MapPrefs>();
         ConnectToServer();
     }
     else
     {
         Debug.LogWarning("WRONG MAP!");
         Disconneted?.Invoke();
         SceneManager.sceneLoaded -= SceneManager_sceneLoaded;
         SceneManager.LoadSceneAsync("Main", LoadSceneMode.Single);
     }
 }