Files
VFSUnity/Assets/Scripts/UI/ModeSelectionUI.cs
T
yangbear f0a6b96da5 feat: MCP Unity 场景优化 — 完整交互体系搭建
- 删除重复 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
2026-06-24 02:33:48 +08:00

73 lines
2.3 KiB
C#

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class ModeSelectionUI : MonoBehaviour
{
[Header("Tip")]
public Text tipText;
[Header("Fixation Mode")]
public Button limbFixationButton;
public Button splintFixationButton;
public GameObject limbFixationCheck;
public GameObject splintFixationCheck;
[Header("Run Mode")]
public Button learnModeButton;
public Button examModeButton;
public GameObject learnModeCheck;
public GameObject examModeCheck;
[Header("Actions")]
public Button startButton;
public Button backButton;
private FixationMethod selectedFixation = FixationMethod.LimbFixation;
private ExperimentMode selectedRunMode = ExperimentMode.Learn;
private void Start()
{
tipText.text = "Tip:请选择实验模式";
limbFixationButton.onClick.AddListener(() => SelectFixation(FixationMethod.LimbFixation));
splintFixationButton.onClick.AddListener(() => SelectFixation(FixationMethod.SplintFixation));
learnModeButton.onClick.AddListener(() => SelectRunMode(ExperimentMode.Learn));
examModeButton.onClick.AddListener(() => SelectRunMode(ExperimentMode.Exam));
startButton.onClick.AddListener(OnStart);
backButton.onClick.AddListener(() => SceneManager.LoadScene("main"));
UpdateSelectionVisuals();
}
private void SelectFixation(FixationMethod mode)
{
selectedFixation = mode;
UpdateSelectionVisuals();
}
private void SelectRunMode(ExperimentMode mode)
{
selectedRunMode = mode;
UpdateSelectionVisuals();
}
private void UpdateSelectionVisuals()
{
limbFixationCheck.SetActive(selectedFixation == FixationMethod.LimbFixation);
splintFixationCheck.SetActive(selectedFixation == FixationMethod.SplintFixation);
learnModeCheck.SetActive(selectedRunMode == ExperimentMode.Learn);
examModeCheck.SetActive(selectedRunMode == ExperimentMode.Exam);
}
private void OnStart()
{
if (GameManager.Instance != null)
{
GameManager.Instance.CurrentFixationMethod = selectedFixation;
GameManager.Instance.CurrentMode = selectedRunMode;
}
SceneManager.LoadScene("Experiment");
}
}