Ejemplo n.º 1
0
 public static void TogglePreview()
 {
     // try to load from manual settings if available
     if (manualPreviewSettings == null)
     {
         manualPreviewSettings = AssetDatabase.LoadAssetAtPath <ManualPreviewSettings>(manualSettingsPath);
     }
     // handle the preview
     HandlePreview(true);
 }
Ejemplo n.º 2
0
        static void CreateManualPreviewAsset()
        {
            ManualPreviewSettings previewSettings = AssetDatabase.LoadAssetAtPath <ManualPreviewSettings>(manualSettingsPath);

            if (previewSettings == null)
            {
                previewSettings = ScriptableObject.CreateInstance <ManualPreviewSettings>();
                AssetDatabase.CreateAsset(previewSettings, manualSettingsPath);
                AssetDatabase.SaveAssets();
            }
            EditorUtility.FocusProjectWindow();
            Selection.activeObject = previewSettings;
        }