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); }
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; }