Example #1
0
        protected override void OnUpdate()
        {
            if (data.Length != 1)
            {
                worker.LogDispatcher.HandleLog(LogType.Error,
                                               new LogEvent($"{typeof(WorkerEntityTag)} should only be present on a single entity"));
            }

            OnDisconnected?.Invoke(data.DisconnectedMessage[0].ReasonForDisconnect);
        }
        protected override void OnUpdate()
        {
            var disconnectData = group.GetSharedComponentDataArray <OnDisconnected>();

            if (disconnectData.Length != 1)
            {
                worker.LogDispatcher.HandleLog(LogType.Error,
                                               new LogEvent($"{typeof(WorkerEntityTag)} should only be present on a single entity"));
            }

            OnDisconnected?.Invoke(disconnectData[0].ReasonForDisconnect);
        }
Example #3
0
        protected override void OnUpdate()
        {
            if (group.CalculateEntityCount() != 1)
            {
                worker.LogDispatcher.HandleLog(LogType.Error,
                                               new LogEvent($"{typeof(WorkerEntityTag)} should only be present on a single entity"));
            }

            Entities.With(group).ForEach((OnDisconnected data) =>
            {
                OnDisconnected?.Invoke(data.ReasonForDisconnect);
            });
        }