예제 #1
0
 public virtual void Invalidate()
 {
     lock (this)
     {
         if (mSessionParameters != null)
         {
             mSessionParameters.Clear();
             mSessionParameters = null;
         }
     }
 }
예제 #2
0
 protected virtual void InvalidateSession()
 {
     if (mSessionParameters != null)
     {
         mSessionParameters.Clear();
         mSessionParameters = null;
     }
     if (mTlsSession != null)
     {
         mTlsSession.Invalidate();
         mTlsSession = null;
     }
 }
예제 #3
0
        // -----------------------------------------
        //			 During one Playthrough
        //------------------------------------------
        /// <summary>
        /// This method is called whenever unity finished loading a scene or we manually move onto a new
        /// scene to update the state of the experiment.
        /// </summary>
        /// <param name="scene">Upcoming scene</param>
        /// <param name="mode">Unity parameter needed to mach listener.</param>
        private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
        {
            if (!_initialized)
            {
                _initialized = true;
                return;
            }

            var isReplay  = FirstPersonController.GetComponentInChildren <ReplayRoute>().isActivated();
            var sceneList = ExperimentSettings.SceneSettings.Scenes;

            _activeSceneName = SceneManager.GetActiveScene().name;
            var subSceneName = sceneList[_currentScene].Name;

            Debug.Log("Scene " + _currentScene + ":" + subSceneName + " in " + _activeSceneName);
            if (!isReplay)
            {
                LoggingManager.InsertLiveSystemEvent("SceneFlow", "switch", null,
                                                     "Scene " + _currentScene + ":" + subSceneName.Substring(0, Math.Min(subSceneName.Length, 25)) + " in " +
                                                     _activeSceneName.Substring(0, Math.Min(_activeSceneName.Length, 25)));
            }

            FirstPersonController.transform.position = Vector3.zero;
            FirstPersonController.transform.rotation = Quaternion.identity;
            FirstPersonController.SetActive(false);
            if (_activeSceneName == "Launcher" && !_inQuestionnaire && !_configureLabchart)
            { //coming back from a scene
                Cursor.lockState = CursorLockMode.None;
                Cursor.visible   = true;

                if (isReplay)
                {
                    MenuManager.InstantiateAndShowMenu("Participant Menu", "Launcher");
                }
                else
                {
                    LoggingManager.LogSceneEnd(subSceneName);
                    if (_currentScene < sceneList.Count - 1)
                    {
                        _currentScene++;
                        LoadCurrentScene();
                        return;
                    }
                    else
                    {
                        MenuManager.InstantiateAndShowMenu("Finish Menu", "Launcher");
                        SessionParameters.Clear();
                        return;
                    }
                }
            }

            //Reset state machine flags for a clean load
            _inQuestionnaire   = false;
            _configureLabchart = false;

            //A new scene started that is not the
            if (!isReplay)
            {
                LoggingManager.LogSceneStart(subSceneName);
            }
        }