protected void ArrivedVisitorCar(FollowPathRightAngles followPath, EntityFuncType entityFuncType) { DebugFile.GetInstance().WriteKeyFile(followPath.ownerEntity.entityID, "{0} {1} ArrivedVisitorCar", followPath.ownerEntity.entityID, entityFuncType); var entity = followPath.ownerEntity as EntityVisitorCar; EntityManager.GetInstance().RemoveFromEntityMovables(entity); // 生成游客 LogWarp.Log("car -> visistor"); switch (entityFuncType) { case EntityFuncType.VisitorCar_EnterZoo: //车到了,刷下游客停车场数量 numShowParking--; ShowLeftParkingNum(numShowParking); SpawnVisitorFromCar.Send(VisitorStage.GotoZoo, EntityFuncType.Visitor_From_Car); #if DEBUG_VISIT BroadcastNum.Send((int)GameMessageDefine.BroadcastVisitorNum, numGroundParkingCar + numUnderParkingCar, 0f, 0); BroadcastNum.Send((int)GameMessageDefine.BroadcastMaxVisitorNum, numMaxParking, 0f, 0); #endif break; case EntityFuncType.VisitorCar_LeaveZoo: break; } }
protected void TickSpawnVisitor(int deltaTimeMS) { if (!isArrivedZoo) { return; } var entity = (this.fsmCtr as FSMMachineShip).ownerEntity; getOffAccumulativeTime += deltaTimeMS; if (getOffAccumulativeTime >= getOffInterval && spawnVisitorNum < entity.maxSpawnVisitorNum) { SpawnVisitorFromCar.Send(VisitorStage.GotoZoo, EntityFuncType.Visitor_From_Ship); spawnVisitorNum++; getOffAccumulativeTime -= getOffInterval; if (spawnVisitorNum == entity.maxSpawnVisitorNum) { isToStateGoback = true; } } }
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; } }