Last improvements on the save front

This commit is contained in:
Michal Pikulski
2025-11-05 17:34:26 +01:00
parent 210823344a
commit c527ba334d
14 changed files with 610 additions and 176 deletions

View File

@@ -123,9 +123,8 @@ namespace Core.SaveLoad
return $"{sceneName}/{customSaveId}";
}
// Auto-generate from hierarchy path
string hierarchyPath = GetHierarchyPath();
return $"{sceneName}/StateMachine_{hierarchyPath}";
// Match ManagedBehaviour convention: SceneName/GameObjectName/ComponentType
return $"{sceneName}/{gameObject.name}/AppleMachine";
}
private string GetSceneName()
@@ -133,19 +132,6 @@ namespace Core.SaveLoad
return gameObject.scene.name;
}
private string GetHierarchyPath()
{
string path = gameObject.name;
Transform parent = transform.parent;
while (parent != null)
{
path = parent.name + "/" + path;
parent = parent.parent;
}
return path;
}
public string SerializeState()
{