ObjectGetRequestHandler.cs 509 B

123456789101112131415
  1. using System;
  2. namespace ET.Server
  3. {
  4. [ActorMessageHandler(SceneType.Location)]
  5. public class ObjectGetRequestHandler: AMActorRpcHandler<Scene, ObjectGetRequest, ObjectGetResponse>
  6. {
  7. protected override async ETTask Run(Scene scene, ObjectGetRequest request, ObjectGetResponse response, Action reply)
  8. {
  9. long instanceId = await scene.GetComponent<LocationComponent>().Get(request.Key);
  10. response.InstanceId = instanceId;
  11. reply();
  12. }
  13. }
  14. }