diff --git a/DotNet/Logic/src/Helper/AddressableSceneHelper.cs b/DotNet/Logic/src/Helper/AddressableSceneHelper.cs new file mode 100644 index 00000000..83466aa0 --- /dev/null +++ b/DotNet/Logic/src/Helper/AddressableSceneHelper.cs @@ -0,0 +1,43 @@ +namespace TEngine.Helper; + +/// +/// 可寻址帮助类。 +/// +public static class AddressableSceneHelper +{ + public static long GetSceneEntityId() + { + var sceneEntityId = 0L; + foreach (var sceneConfig in SceneConfigData.Instance.List) + { + if (sceneConfig.RouteId == 3072) + { + sceneEntityId = sceneConfig.EntityId; + break; + } + } + return sceneEntityId; + } + + public static long GetSceneEntityIdByType(Logic.SceneType sceneType) + { + var sceneEntityId = 0L; + foreach (var sceneConfig in SceneConfigData.Instance.List) + { + if (sceneConfig.SceneType.Parse() == sceneType) + { + sceneEntityId = sceneConfig.EntityId; + break; + } + } + return sceneEntityId; + } + + public static long GetSceneEntityIdByRouteId(uint routeId) + { + var sceneEntityId = 0L; + var sceneConfig = SceneConfigData.Instance.Get(routeId); + sceneEntityId = sceneConfig.EntityId; + return sceneEntityId; + } +} \ No newline at end of file