屏蔽门关门故障暂提代码
This commit is contained in:
parent
0f5f0ea488
commit
9f9151afe6
@ -46,7 +46,6 @@ enum ScreenDoor_State{
|
||||
func openScreenDoor (isUseLCBKey=false)-> void:
|
||||
if screenDoorState == ScreenDoor_State.close and (screenDoorFaultState != ScreenDoor_Fault_State.openFault or isUseLCBKey):
|
||||
screenDoorState=ScreenDoor_State.opening
|
||||
$Timer.connect('timeout', _on_timer_timeout)
|
||||
$Timer.start(0.3)
|
||||
|
||||
|
||||
@ -56,7 +55,6 @@ func closeScreenDoor (isUseLCBKey=false)-> void:
|
||||
mtd_fault_material.set_shader_parameter('is_dark', false)
|
||||
if screenDoorState == ScreenDoor_State.open and (screenDoorFaultState != ScreenDoor_Fault_State.closeFault or isUseLCBKey):
|
||||
screenDoorState=ScreenDoor_State.closeing
|
||||
$Timer.connect('timeout', _on_timer_timeout)
|
||||
$Timer.start(0.3)
|
||||
|
||||
|
||||
@ -72,6 +70,8 @@ func _on_left_animation_player_animation_finished(anim_name: StringName) -> void
|
||||
$Timer.stop()
|
||||
is_dark = true
|
||||
_set_mtd(is_dark)
|
||||
if screenDoorFaultState == ScreenDoor_Fault_State.closeFault:
|
||||
$SpotLight3D.show()
|
||||
|
||||
|
||||
## 屏蔽门的故障枚举
|
||||
@ -92,7 +92,6 @@ enum ScreenDoor_Fault_State{
|
||||
##设置故障
|
||||
func setScreenDoorFault (faultType:ScreenDoor_Fault_State)-> void:
|
||||
screenDoorFaultState = faultType
|
||||
print(screenDoorFaultState, faultType, 'ppp')
|
||||
if faultType == ScreenDoor_Fault_State.glassBreakage :
|
||||
$leftDoor_broken.visible = true
|
||||
$leftDoor_broken/AudioStreamPlayer.play()
|
||||
@ -126,8 +125,8 @@ signal clicksScreenDoorSignal(screenDoor,mousePosition)
|
||||
|
||||
var is_dark = true
|
||||
func _on_timer_timeout():
|
||||
is_dark = !is_dark
|
||||
_set_mtd(is_dark)
|
||||
is_dark = !is_dark
|
||||
_set_mtd(is_dark)
|
||||
|
||||
func _set_mtd(dark):
|
||||
if is_dark:
|
||||
@ -139,4 +138,5 @@ func _set_mtd(dark):
|
||||
|
||||
func _ready():
|
||||
$MTD.material_override = mtd_material
|
||||
$Timer.connect('timeout', _on_timer_timeout)
|
||||
_set_mtd(is_dark)
|
||||
|
@ -13,3 +13,11 @@ func _ready():
|
||||
func _on_training_desc_dialog_start_training():
|
||||
$total.trainComeAndOpenScreenDoor()
|
||||
$total.setAssignScreenDoorsCloseFault([TotalScene.ScreenDoor_name.screenDoor2])
|
||||
$DepartTimer.wait_time = 30
|
||||
$DepartTimer.one_shot = true
|
||||
$DepartTimer.connect("timeout", depart)
|
||||
$DepartTimer.start()
|
||||
|
||||
func depart():
|
||||
$total.closeScreenDoor()
|
||||
|
||||
|
@ -13,4 +13,6 @@ sceneDesc = "上行门头灯亮关门故障"
|
||||
|
||||
[node name="total" parent="." instance=ExtResource("2_ykkar")]
|
||||
|
||||
[node name="DepartTimer" type="Timer" parent="."]
|
||||
|
||||
[connection signal="StartTraining" from="TrainingDescDialog" to="." method="_on_training_desc_dialog_start_training"]
|
||||
|
Loading…
Reference in New Issue
Block a user