From c0f7146c488928499c0564e62829d5094e09c94f Mon Sep 17 00:00:00 2001 From: Paul Du Bois Date: Tue, 5 Sep 2017 20:53:14 -0700 Subject: [PATCH] MenuItem_UpdateManifest fixes Undo.RecordObject is only for scene objects. For assets, ignore the scary language in the docs and use EditorUtility.SetDirty; it's exactly the correct thing to do. Change-Id: I9b8fff3918f65181ea23fac908346b75eed06167 --- .../Assets/TiltBrush/Scripts/BrushManifest.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/UnitySDK/Assets/TiltBrush/Scripts/BrushManifest.cs b/UnitySDK/Assets/TiltBrush/Scripts/BrushManifest.cs index 190cc249..b346371e 100644 --- a/UnitySDK/Assets/TiltBrush/Scripts/BrushManifest.cs +++ b/UnitySDK/Assets/TiltBrush/Scripts/BrushManifest.cs @@ -72,17 +72,19 @@ public ILookup BrushesByName { } } - /* - [MenuItem("Tilt Brush/Update Manifest")] +#if false +#if UNITY_EDITOR + [UnityEditor.MenuItem("Tilt Brush/Update Manifest")] public static void MenuItem_UpdateManifest() { BrushManifest manifest = Instance; - Undo.RecordObject(manifest, "Recreate brush list"); - manifest.m_Brushes = AssetDatabase.FindAssets("t:BrushDescriptor") - .Select(g => AssetDatabase.GUIDToAssetPath(g)) - .Select(p => AssetDatabase.LoadAssetAtPath(p)) + manifest.m_Brushes = UnityEditor.AssetDatabase.FindAssets("t:BrushDescriptor") + .Select(g => UnityEditor.AssetDatabase.GUIDToAssetPath(g)) + .Select(p => UnityEditor.AssetDatabase.LoadAssetAtPath(p)) .ToArray(); + UnityEditor.EditorUtility.SetDirty(manifest); } - */ +#endif +#endif } }