void IGamePlaySystem.OnGamePlay() { var objs = _eventObjects.GetEntities(); var objCount = _eventObjects.Count(); for (int i = 0; i < objCount; ++i) { var obj = objs[i]; var syncEvents = obj.triggerObjectEvent.SyncEvents; while (syncEvents.Count > 0) { var evt = syncEvents.Dequeue(); switch (evt.EType) { case TriggerObjectSyncEventType.DetachChunk: ProcessDetachChunkEvent(obj, (ChunkSyncEvent)evt); break; case TriggerObjectSyncEventType.BreakChunk: ProcessBreakChunkEvent(obj, (ChunkSyncEvent)evt); break; } evt.ReleaseReference(); } obj.isTriggerObjectEventFlag = false; } }
public void Update() { var objs = _deactiveMapObjects.GetEntities(); for (int i = 0; i < objs.Length; ++i) { var obj = objs[i]; var id = obj.triggerObjectId.Id; var go = GetTriggerObject(id); if (go != null) { if (_logger.IsDebugEnabled) { _logger.DebugFormat("Trigger Object: Type {0} id {1} Loaded On Update Self Position {2}.", _triggerType, id, _contexts.player.flagSelfEntity.position.Value); } OnDeativeObjectActive(id, obj, go); } } if (_deactiveMapObjects.Any()) { _logger.DebugFormat("Waiting For Trigger Object Loading: Type {0} Count {1}", _triggerType, _deactiveMapObjects.Count()); } }