WorldSceneDetailsCacheEditor - jimdroberts/FishMMO GitHub Wiki

Description

Custom editor for WorldSceneDetailsCache ScriptableObject. Adds a "Rebuild" button to the inspector for manual cache rebuilding.


API Access

Methods

  • 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.


Basic Usage

Setup

  1. Place this script in an Editor folder within your project to ensure it is only included in the Unity Editor build.
  2. Select a WorldSceneDetailsCache asset in the Inspector to use the custom editor.
  3. Click the "Rebuild" button in the Inspector to manually trigger a cache rebuild and mark the asset as dirty for saving.

Example

// 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.

Best Practices

  • 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.
⚠️ **GitHub.com Fallback** ⚠️