分阶段控制生成人的频率

This commit is contained in:
joylink_zhaoerwei 2024-07-29 11:42:29 +08:00
parent 4b2f6fa619
commit 37442e4f27
2 changed files with 17 additions and 4 deletions

View File

@ -307,9 +307,17 @@ func startGeneratePeopleAtCD() -> void:
$AllTimer/generatePeopleCEntranceTimer.start()
$AllTimer/generatePeopleDEntranceTimer.start()
func reduceInboundPassengerFlowAtA() -> void:
$AllTimer/generatePeopleAEntranceTimer.wait_time = 4
$AllTimer/generatePeopleAtBLowerStepTimer.wait_time = 6
$AllTimer/generatePeopleAtBInboundGateArea.wait_time = 3
allGeneratePeopleAtDownPlatform = allGeneratePeopleAtDownPlatform.slice(16, allGeneratePeopleAtDownPlatform.size())
for child in allGeneratePeopleAtDownPlatform :
child.queue_free()
func stopGeneratePeopleAtA() -> void:
$AllTimer/generatePeopleAEntranceTimer.stop()
$AllTimer/generatePeopleAtBTicketingArea.stop()
$AllTimer/generatePeopleAtBInboundGateArea.stop()
func stopGeneratePeopleAtB() -> void:
@ -325,6 +333,8 @@ func stopGeneratePeopleAtD() -> void:
##A入口生成
var totalOfAEntrance=0
func generatePeopleAtAEntrance() -> void:
if totalOfAEntrance > 30:
$AllTimer/generatePeopleAEntranceTimer.wait_time = 3
if $AllAreaDetection/APassageAreaDetection.passPeopleCount< 1 and currentActiveCameraOfLarge != Camera_name.APassage:
generatePeopleAPassage()
if $AllAreaDetection/TicketingLfetAreaDetection.waitPeopleCount< 1 and currentActiveCameraOfLarge != Camera_name.BTVM:
@ -382,6 +392,7 @@ func generatePeopleAtBTicketingArea() -> void:
func letPeopleWaitTrainAtDownPlatform() -> void:
currentNeedGenerate = 16
$AllTimer/generatePeopleDownPlatformTimer.start()
$AllTimer/generatePeopleAtBTicketingArea.stop()
var totalOfDownPlatform = 0
var currentNeedGenerate = 4
@ -511,9 +522,6 @@ func peopleAtDownPlatformDecreased() -> void:
for child in allPeopleAtDownPlatform :
child.position.y = 0.85
child.get_node('Player').state_machine.change_state("Idle")
allGeneratePeopleAtDownPlatform = allGeneratePeopleAtDownPlatform.slice(16, allGeneratePeopleAtDownPlatform.size())
for child in allGeneratePeopleAtDownPlatform :
child.queue_free()
func temporaryTicketOfficeComing() -> void:

View File

@ -310,6 +310,7 @@ var handleStep = [
{
"stepName": "启动一级客流控制\n步骤八:站厅站务员在各楼梯处设置警戒线。(B端)",
"stepOperation": ['BGangway','picketline'],
"doAfterFinisnStepOperation":reduceInboundPassengerFlowAtA,
"next": false,
"play": false,
"playPath": "",
@ -813,6 +814,10 @@ func startGeneratePeopleAtCD(currentStep) -> void:
nextStep()
$total.startGeneratePeopleAtCD()
func reduceInboundPassengerFlowAtA(currentStep) -> void:
nextStep()
$total.reduceInboundPassengerFlowAtA()
func stopGeneratePeopleAtA(currentStep) -> void:
nextStep()
$total.stopGeneratePeopleAtA()