示例#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);
 }
示例#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;
        }