Exemple #1
0
 public static string[] OnWillSaveAssets(string[] assetPaths)
 {
     // We really don't want to crash the Unity asset processor!
     try {
         AssetSettingManagement.SaveSettings();
     }
     catch (Exception ex) {
         Debug.LogException(ex);
     }
     return(assetPaths);
 }
        private static void OnPlayModeStateChanged(PlayModeStateChange change)
        {
            // Ensure that tool is deactivated when switching between play/edit mode.
            ToolManager.Instance.CurrentTool = null;

            // Assembly will get reloaded real soon, so let's save user settings
            // just in case Unity explodes.
            AssetSettingManagement.SaveSettings();

            // Attempt to recover previously active tile system editor preferences.
            int instanceID = s_setting_ActiveTileSystemInstanceID.Value;

            ToolUtility.ActiveTileSystem = (instanceID != -1)
                ? EditorUtility.InstanceIDToObject(instanceID) as TileSystem
                : null;

            RepaintScenePalette();
        }