This commit is contained in:
2025-08-31 20:46:27 +02:00
parent 2d06552025
commit 104259f79b
11 changed files with 310 additions and 137 deletions

View File

@@ -224,6 +224,15 @@ namespace RebootKit.Engine.Main {
return Network.Actors.SpawnActor(assetReference, position, rotation);
}
public static void DestroyActor(Actor actor) {
if (actor == null) {
s_Logger.Error("Cannot destroy actor. Actor is null.");
return;
}
Network.Actors.DestroyActor(actor);
}
public static Actor FindSpawnedActor(ushort actorID) {
if (Network is null) {
s_Logger.Error("NetworkSystemInstance is not initialized. Cannot find actor.");
@@ -252,6 +261,16 @@ namespace RebootKit.Engine.Main {
Network.SendPossessedActor(clientID, actorID);
}
public static IEnumerable<Actor> Actors() {
foreach (Actor actor in Network.Actors.InSceneActors) {
yield return actor;
}
foreach (Actor actor in Network.Actors.SpawnedActors) {
yield return actor;
}
}
//
// @MARK: Service API
// Services seems to be useless in the current architecture. Consider removing this API in the future.