Skip to content

Commit

Permalink
MenuItem_UpdateManifest fixes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dubois committed Oct 5, 2017
1 parent b5e8a1d commit c0f7146
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions UnitySDK/Assets/TiltBrush/Scripts/BrushManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,19 @@ public ILookup<string, BrushDescriptor> 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<BrushDescriptor>(p))
manifest.m_Brushes = UnityEditor.AssetDatabase.FindAssets("t:BrushDescriptor")
.Select(g => UnityEditor.AssetDatabase.GUIDToAssetPath(g))
.Select(p => UnityEditor.AssetDatabase.LoadAssetAtPath<BrushDescriptor>(p))
.ToArray();
UnityEditor.EditorUtility.SetDirty(manifest);
}
*/
#endif
#endif
}

}

0 comments on commit c0f7146

Please sign in to comment.