game version overlay, working on actors sync

This commit is contained in:
2025-07-16 23:03:48 +02:00
parent 0da6f275c0
commit 4ec3dedd42
31 changed files with 1826 additions and 680 deletions

3
Editor/Background.meta Normal file
View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 94ddf6c8713749dda84e4de934d39bf0
timeCreated: 1752350242

View File

@@ -0,0 +1,34 @@
using RebootKit.Engine.Foundation;
using RebootKit.Engine.Simulation;
using UnityEditor;
using UnityEngine;
namespace RebootKit.Editor.Background {
[InitializeOnLoad]
public class EnsureUniqueActorID {
static EnsureUniqueActorID() {
ObjectChangeEvents.changesPublished += OnObjectChange;
}
static void OnObjectChange(ref ObjectChangeEventStream stream) {
for (int i = 0; i < stream.length; ++i) {
switch (stream.GetEventType(i)) {
case ObjectChangeKind.CreateGameObjectHierarchy:
stream.GetCreateGameObjectHierarchyEvent(i, out CreateGameObjectHierarchyEventArgs createEvent);
GameObject gameObjectChanged =
EditorUtility.InstanceIDToObject(createEvent.instanceId) as GameObject;
if (gameObjectChanged != null && gameObjectChanged.TryGetComponent(out Actor actor)) {
actor.ActorID = UniqueID.NewULongFromGuid();
EditorUtility.SetDirty(actor);
}
break;
}
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bccf1b1891f9486e85330d8c7be3ea52
timeCreated: 1752350253

View File

@@ -1,6 +1,6 @@
{
"name": "SzafaKitEditor",
"rootNamespace": "RebootKitEditor",
"name": "RebootKit.Editor",
"rootNamespace": "RebootKit.Editor",
"references": [
"GUID:284059c7949783646b281a1b815580e6",
"GUID:9e24947de15b9834991c9d8411ea37cf",