Last improvements on the save front
This commit is contained in:
31
Assets/Editor/Tools/DebugSaveIds.cs
Normal file
31
Assets/Editor/Tools/DebugSaveIds.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
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 ===");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user