Files
AppleHillsProduction/Assets/Editor/Tools/DebugSaveIds.cs
2025-11-07 13:54:40 +01:00

32 lines
962 B
C#

using UnityEngine;
using UnityEditor;
using Core.Lifecycle;
namespace Editor.Tools
{
/// <summary>
/// Editor utility to debug SaveIds for all ManagedBehaviours in the scene
/// </summary>
public class DebugSaveIds : EditorWindow
{
[MenuItem("Tools/Debug/Log All SaveIds")]
public static void LogAllSaveIds()
{
var allManaged = FindObjectsByType<ManagedBehaviour>(FindObjectsInactive.Include, FindObjectsSortMode.None);
Debug.Log($"=== Found {allManaged.Length} ManagedBehaviours ===");
foreach (var managed in allManaged)
{
if (managed.AutoRegisterForSave)
{
Debug.Log($"GameObject: {managed.gameObject.name} | Component: {managed.GetType().Name} | SaveID: {managed.SaveId}");
}
}
Debug.Log("=== End SaveIds ===");
}
}
}