示例#1
0
        public void SendRequestRespawnCommand(HealthComponent.RequestRespawn.Request request, Action <Improbable.Gdk.Health.HealthComponent.RequestRespawn.ReceivedResponse> callback = null)
        {
            int validCallbackEpoch = callbackEpoch;
            var requestId          = commandSender.SendCommand(request, entity);

            if (callback != null)
            {
                Action <Improbable.Gdk.Health.HealthComponent.RequestRespawn.ReceivedResponse> wrappedCallback = response =>
                {
                    if (!this.IsValid || validCallbackEpoch != this.callbackEpoch)
                    {
                        return;
                    }

                    callback(response);
                };
                callbackSystem.RegisterCommandResponseCallback(requestId, wrappedCallback);
            }
        }
示例#2
0
        public void SendRequestRespawnCommand(EntityId targetEntityId, global::Improbable.Common.Empty request, Action <Improbable.Gdk.Health.HealthComponent.RequestRespawn.ReceivedResponse> callback = null)
        {
            var commandRequest = new HealthComponent.RequestRespawn.Request(targetEntityId, request);

            SendRequestRespawnCommand(commandRequest, callback);
        }