2024-05-10 08:31:11 +08:00
|
|
|
extends Node
|
|
|
|
|
|
|
|
## 实训名称
|
|
|
|
@export var trainingName: String = "实训"
|
|
|
|
## 场景描述
|
|
|
|
@export var trainingDesc: String = "场景描述"
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
$TrainingDescDialog.title = trainingName
|
|
|
|
$TrainingDescDialog.updateSceneDesc(trainingDesc)
|
|
|
|
|
|
|
|
|
|
|
|
func _on_training_desc_dialog_start_training():
|
|
|
|
$total.trainComeAndOpenScreenDoor()
|
|
|
|
$total.setAssignScreenDoorsCloseFault([TotalScene.ScreenDoor_name.screenDoor2])
|
2024-05-10 09:36:11 +08:00
|
|
|
$DepartTimer.wait_time = 15
|
2024-05-10 09:30:37 +08:00
|
|
|
$DepartTimer.one_shot = true
|
|
|
|
$DepartTimer.connect("timeout", depart)
|
|
|
|
$DepartTimer.start()
|
2024-05-11 14:27:21 +08:00
|
|
|
var sound = load_mp3("res://Assets/training_speech/gmgz/2hmgmgz.mp3")
|
|
|
|
$VoiceCommunication.play_reply(sound)
|
2024-05-10 09:30:37 +08:00
|
|
|
|
|
|
|
func depart():
|
|
|
|
$total.closeScreenDoor()
|
|
|
|
|
2024-05-11 14:27:21 +08:00
|
|
|
|
|
|
|
func load_mp3(path):
|
|
|
|
var file = FileAccess.open(path, FileAccess.READ)
|
|
|
|
var sound = AudioStreamMP3.new()
|
|
|
|
sound.data = file.get_buffer(file.get_length())
|
|
|
|
return sound
|