f0a6b96da5
- 删除重复 Ground - 创建 [Managers] 空物体,挂载 GameManager + StepManager + ExperimentFlowCoordinator + AudioManager - Main Camera 挂载 InteractionSystem - 伤者 InjectedPerson 下创建 5 个交互子物体 (InjuryVisual/Swelling/Pain/VitalSigns/Neuro) - 创建绑带位置、踝关节、衬垫、夹板位置等空物体 - 道具摆放到位:伤者(2,0.05,5) 施救者(3,0,5) 鞋(2.7,0.15,5.5) 绷带/夹板/急救箱在旁 - InjuryLeg Tag 修正,Ground Tag 修正 - 全部新脚本同步导入 (ExperimentTypes/StepData/ExperimentConfig/StepManager/GameManager/ExperimentFlowCoordinator/InteractionSystem/DraggableObject/HighlightEffect/UIManager/ExamPopup/ScoreDisplay/VideoController/AudioManager/CharacterAnimController/StepAnimationHandler) - 旧脚本 (ExperimentController/ConfigLoader/AnimationController/HUDController/VideoPlayerController/PopupSystem/ModeSelectionUI) 全部兼容修复或 stub - 编译通过,0 错误 - Canvas 挂载 UIManager
39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
/// <summary>
|
|
/// Main menu UI — assign all fields in Inspector.
|
|
/// </summary>
|
|
public class MainMenuUI : MonoBehaviour
|
|
{
|
|
[Header("Text")]
|
|
public Text titleText;
|
|
public Text versionText;
|
|
|
|
[Header("Buttons")]
|
|
public Button cprButton;
|
|
public Button fractureButton;
|
|
public Button sprainButton;
|
|
public Button bleedingButton;
|
|
public Button transportButton;
|
|
|
|
private void Start()
|
|
{
|
|
if (titleText != null) titleText.text = "运动伤害现场急救处理虚拟仿真实验";
|
|
if (versionText != null) versionText.text = $"v{Application.version}";
|
|
|
|
if (cprButton != null) cprButton.onClick.AddListener(() => OnSelect("CPR"));
|
|
if (fractureButton != null) fractureButton.onClick.AddListener(() => OnSelect("FractureFixation"));
|
|
if (sprainButton != null) sprainButton.onClick.AddListener(() => OnSelect("SprainBandage"));
|
|
if (bleedingButton != null) bleedingButton.onClick.AddListener(() => OnSelect("BleedingBandage"));
|
|
if (transportButton != null) transportButton.onClick.AddListener(() => OnSelect("CasualtyTransport"));
|
|
}
|
|
|
|
private void OnSelect(string experimentId)
|
|
{
|
|
PlayerPrefs.SetString("SelectedExperiment", experimentId);
|
|
SceneManager.LoadScene("ModeSelection");
|
|
}
|
|
}
|