extends Node3D class_name TotalScene ##开始实训,车主动来和开屏蔽门 func beginTraining ()-> void: $train.trainCome() $BeginTimer.start() func _on_beginTimer_timeout() -> void: $Timer.start() $train.openLeftTrainDoorALL() $platform.openScreenDoorALL() func _on_timer_timeout() -> void: $train.closeLeftTrainDoorALL() $platform.closeScreenDoorALL() $EndTimer.start() func _on_end_timer_timeout() -> void: $train.trainLeave() ##关屏蔽门 func closeAllScreenDoor() -> void: pass ## 屏蔽门名字的枚举 enum ScreenDoor_name{ screenDoor1=1, screenDoor2, screenDoor3, screenDoor4, } ##设置指定屏蔽门开门故障 func setAssignScreenDoorsOpenFault (screenDoorNames:Array)-> void: setAssignScreenDoorsFault(screenDoorNames,ScreenDoor.ScreenDoor_Fault_State.openFault) ##设置指定屏蔽门关门故障 func setAssignScreenDoorsCloseFault (screenDoorNames:Array)-> void: setAssignScreenDoorsFault(screenDoorNames,ScreenDoor.ScreenDoor_Fault_State.closeFault) ##设置指定屏蔽门玻璃破碎故障 func setAssignScreenDoorsGlassBreakageFault (screenDoorNames:Array)-> void: setAssignScreenDoorsFault(screenDoorNames,ScreenDoor.ScreenDoor_Fault_State.glassBreakage) func setAssignScreenDoorsFault (screenDoorNames:Array,faultType:ScreenDoor.ScreenDoor_Fault_State)-> void: for child in $platform.screenDoorALL: var screenDoorName=String(child.name) var screenDoorIndex=int(screenDoorName[screenDoorName.length() - 1]) if screenDoorIndex in screenDoorNames: child.setScreenDoorFault(faultType)