public void AddAndRemoveTask()
 {
     Assert.AreEqual(0, m_Module.tasks.Count);
     Assert.True(m_Module.AddSlowTask(m_DefaultAction, k_DefaultInterval));
     Assert.AreEqual(1, m_Module.tasks.Count);
     Assert.True(m_Module.RemoveSlowTask(m_DefaultAction));
     Assert.AreEqual(0, m_Module.tasks.Count);
 }
        void IModule.UnloadModule()
        {
            CleanupVisuals();

            m_SlowTaskModule.RemoveSlowTask(UpdateVisuals);
            m_SlowTaskModule.RemoveSlowTask(ScanEntitiesAndCreateVisuals);
            m_FaceVisuals.Clear();

#if UNITY_EDITOR
            EditorApplication.update          -= EditorUpdateSlowTask;
            EditorOnlyDelegates.IsGizmosCamera = null;
            Selection.selectionChanged        -= OnSelectionChanged;
#endif

            m_PrefabStageScene = default(Scene);
            simEntitiesRoot    = null;

            m_UpdateTask = null;
            m_RescanTask = null;
            m_Loaded     = false;
        }
        void IModule.UnloadModule()
        {
            m_InitializationTimeCounter = 0;

#if UNITY_MARS_USE_LOCATION
            switch (Input.location.status)
            {
            case LocationServiceStatus.Initializing:
                m_SlowTaskModule.RemoveSlowTask(ServiceStartTask);
                break;

            case LocationServiceStatus.Running:
                if (m_ContinuousUpdates)
                {
                    m_SlowTaskModule.RemoveSlowTask(UpdateLocationTask);
                }
                break;
            }
#endif
        }