protected void TickShuttleVisistorNum(int deltaTimeMS) { this.shuttleaccumulativeTime += deltaTimeMS; if (shuttleVisitorQueue.Count >= ExitGateModule.GetMaxShuttleVisitor() && shuttleaccumulativeTime >= maxShuttleInterval) { shuttleVisitorList.Clear(); for (int i = 0; i < ExitGateModule.GetMaxShuttleVisitor(); i++) { var entity = shuttleVisitorQueue.Dequeue(); EntityManager.GetInstance().RemoveFromEntityMovables(entity); var shuttleVisitor = new ShuttleVisitor(); shuttleVisitor.Init(entity.entityID, (EntityFuncType)entity.entityFuncType); shuttleVisitorList.Add(shuttleVisitor); } //MessageManager.GetInstance().Send((int)GameMessageDefine.SpawnShuttle); SpawnShuttle.Send(shuttleVisitorList); shuttleaccumulativeTime -= maxShuttleInterval; #if DEBUG_VISIT BroadcastNum.Send((int)GameMessageDefine.BroadcastShuttleVisistorNum, shuttleVisitorQueue.Count, 0f, 0); #endif } }
protected void TickSpawnVisitor(int deltaTimeMS) { var entity = (this.fsmCtr as FSMMachineShuttle).ownerEntity; getOffAccumulativeTime += deltaTimeMS; if (getOffAccumulativeTime >= shuttleVisitorGetOffInterval && lastVisitorIdx < ExitGateModule.GetMaxShuttleVisitor() && isGetOff && lastVisitorIdx < entity.shuttleVisitorList.Count) { SpawnVisitorFromCar.Send(VisitorStage.GotoParking, entity.shuttleVisitorList[lastVisitorIdx].entityFuncType); if (lastVisitorIdx == ExitGateModule.GetMaxShuttleVisitor() - 1) { isGetOff = false; lastVisitorIdx = 0; isToStateShuttleGobackCalcPath = true; } else { lastVisitorIdx++; } getOffAccumulativeTime -= shuttleVisitorGetOffInterval; } }