mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
Create AddressableSceneHelper.cs
This commit is contained in:
43
DotNet/Logic/src/Helper/AddressableSceneHelper.cs
Normal file
43
DotNet/Logic/src/Helper/AddressableSceneHelper.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
namespace TEngine.Helper;
|
||||
|
||||
/// <summary>
|
||||
/// 可寻址帮助类。
|
||||
/// </summary>
|
||||
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<Logic.SceneType>() == 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user