Ejemplo n.º 1
0
 /// <summary>
 /// On destroy, saves an update indicator if exiting play mode after reconstruction.
 /// </summary>
 void OnDestroy()
 {
     if (hasPerformedSparseReconstruction && EditorApplication.isPlaying && GeneralToolkit.IsStartingNewScene())
     {
         PrefabUtility.SaveAsPrefabAsset(gameObject, Path.Combine("Assets", _updateDirectoryIndicatorPathEnd));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Remove camera models on destroy.
 /// </summary>
 void OnDestroy()
 {
     if (!GeneralToolkit.IsStartingNewScene())
     {
         ResetCameraModels();
     }
 }
 /// <summary>
 /// On destroy, destroys the created objects.
 /// </summary>
 void OnDestroy()
 {
     if (!GeneralToolkit.IsStartingNewScene())
     {
         GeneralToolkit.RemoveChildComponents(transform, typeof(CameraSetup), typeof(DataHandler), typeof(PreviewCameraManager));
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Clears all created objects.
        /// </summary>
        void OnDestroy()
        {
            if (!GeneralToolkit.IsStartingNewScene())
            {
#if UNITY_EDITOR
                Deselected();
#endif //UNITY_EDITOR
                GeneralToolkit.RemoveChildComponents(transform, typeof(CameraSetup), typeof(DataHandler));
                GeneralToolkit.RemoveChildren(transform, ExternalHelper.EHTransformName, ProcessingMethod.PMTransformName,
                                              RenderingMethod.RMTransformName, EvaluationMethod.EMTransformName);
            }
        }
 /// <summary>
 /// On destroy, destroys the potentially copied mesh in the Resources folder.
 /// </summary>
 public virtual void OnDestroy()
 {
     if (_loadedMeshFullPath != null)
     {
         bool isInResources = _loadedMeshFullPath.Contains(COLIBRIVRSettings.settingsResourcesAbsolutePath);
         if (isInResources && EditorApplication.isPlaying && GeneralToolkit.IsStartingNewScene())
         {
             GeneralToolkit.Delete(_loadedMeshFullPath);
             AssetDatabase.Refresh();
         }
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// On enable, changes the workspace if entering edit mode after having performed reconstruction in play mode.
 /// </summary>
 void OnEnable()
 {
     if (!EditorApplication.isPlaying && GeneralToolkit.IsStartingNewScene())
     {
         string indicatorPathAbsolute = Path.Combine(Application.dataPath, _updateDirectoryIndicatorPathEnd);
         if (File.Exists(indicatorPathAbsolute))
         {
             ChangeWorkspaceAfterSparseReconstruction();
             GeneralToolkit.Delete(indicatorPathAbsolute);
             AssetDatabase.Refresh();
         }
     }
 }