chore: added assert for universe entrance manager issue

This commit is contained in:
2025-10-22 23:44:29 +03:00
parent 193b2c5af0
commit 2ef7fa6577

View File

@@ -19,6 +19,7 @@ public class UniverseEntranceManager : Internal.BehaviourIndependent
// FIXME: This causes an issue when the UniverseEntranceManager is already attached to a UniverseObject then registered into a Universe,
// the enter/exit universe collectors call OnUniverseObjectRegistered internally on Assign, but since the Universe calls the OnUniverseObjectRegistered
// event it tries to call OnUniverseObjectRegistered again on the same object, causing a duplicate entry error.
Debug.Assert.AssertTrue(BehaviourController.Count == 1, $"{nameof(UniverseEntranceManager)} must be in it's own {nameof(IUniverseObject)} with no other {nameof(IBehaviour)}s attached at the moment. Failing to do so might cause instantiation or serialization issues.");
enterUniverses.Assign(universe);
exitUniverses.Assign(universe);