WorldSceneDetailsCacheEditor - jimdroberts/FishMMO GitHub Wiki
Custom editor for WorldSceneDetailsCache ScriptableObject. Adds a "Rebuild" button to the inspector for manual cache rebuilding.
-
public override void OnInspectorGUI()
Draws the custom inspector GUI, including the "Rebuild" button. When pressed, triggers the cache rebuild and marks the asset as dirty.
- Place this script in an
Editor
folder within your project to ensure it is only included in the Unity Editor build. - Select a
WorldSceneDetailsCache
asset in the Inspector to use the custom editor. - Click the "Rebuild" button in the Inspector to manually trigger a cache rebuild and mark the asset as dirty for saving.
// Example 1: Using the custom editor
// 1. Select the WorldSceneDetailsCache asset in the Project window.
// 2. In the Inspector, click the "Rebuild" button to update the cache.
- Always place custom editor scripts inside an
Editor
folder to avoid including them in builds. - Use the "Rebuild" button after making changes to scene configuration sources to ensure the cache is up to date.
- Mark the asset as dirty after rebuilding so changes are saved when the project is saved.