diff --git a/Unity/Assets/Scripts/Core/World/Singleton.cs b/Unity/Assets/Scripts/Core/World/Singleton.cs index 51aacbdb1d6..bfd400ac61f 100644 --- a/Unity/Assets/Scripts/Core/World/Singleton.cs +++ b/Unity/Assets/Scripts/Core/World/Singleton.cs @@ -17,6 +17,7 @@ public abstract class Singleton: ASingleton where T: Singleton [StaticField] private static T instance; + [StaticField] public static T Instance { get diff --git a/Unity/Assets/Scripts/Core/World/World.cs b/Unity/Assets/Scripts/Core/World/World.cs index 0eac1af6310..f7bd51d7fe0 100644 --- a/Unity/Assets/Scripts/Core/World/World.cs +++ b/Unity/Assets/Scripts/Core/World/World.cs @@ -8,6 +8,7 @@ public class World: IDisposable [StaticField] private static World instance; + [StaticField] public static World Instance { get diff --git a/Unity/Assets/Scripts/Model/Share/Module/Message/Session.cs b/Unity/Assets/Scripts/Model/Share/Module/Message/Session.cs index 829e68cddf3..aa5f59ff61e 100644 --- a/Unity/Assets/Scripts/Model/Share/Module/Message/Session.cs +++ b/Unity/Assets/Scripts/Model/Share/Module/Message/Session.cs @@ -66,7 +66,7 @@ public static void OnResponse(this Session self, IResponse response) public static async ETTask Call(this Session self, IRequest request, ETCancellationToken cancellationToken) { - int rpcId = ++Session.RpcId; + int rpcId = ++self.RpcId; RpcInfo rpcInfo = new RpcInfo(request); self.requestCallbacks[rpcId] = rpcInfo; request.RpcId = rpcId; @@ -102,7 +102,7 @@ void CancelAction() public static async ETTask Call(this Session self, IRequest request, int time = 0) { - int rpcId = ++Session.RpcId; + int rpcId = ++self.RpcId; RpcInfo rpcInfo = new(request); self.requestCallbacks[rpcId] = rpcInfo; request.RpcId = rpcId; @@ -150,7 +150,7 @@ public sealed class Session: Entity, IAwake, IDestroy { public AService AService { get; set; } - public static int RpcId + public int RpcId { get; set;