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
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Defines an exam question with multiple choices.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "ExamQuestion", menuName = "VFS/Exam Question")]
|
||||
public class ExamQuestionData : ScriptableObject
|
||||
{
|
||||
[Header("Question Info")]
|
||||
public int questionIndex;
|
||||
[TextArea(2, 4)]
|
||||
public string questionText;
|
||||
|
||||
[Header("Choices")]
|
||||
public string[] choices;
|
||||
public int correctChoiceIndex;
|
||||
|
||||
[Header("Feedback")]
|
||||
[TextArea(2, 4)]
|
||||
public string correctFeedback;
|
||||
[TextArea(2, 4)]
|
||||
public string incorrectFeedback;
|
||||
|
||||
[Header("Interaction")]
|
||||
public QuestionType questionType;
|
||||
public string targetTag;
|
||||
|
||||
public enum QuestionType
|
||||
{
|
||||
MultipleChoice,
|
||||
ClickTarget,
|
||||
SequenceOrder
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ac09a60490764c18ba4d4b5616370e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 单个实验类型的完整配置:包含学习模式与考核模式的所有步骤。
|
||||
/// 在 Unity Editor 中为每种实验类型各创建一份 Asset。
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "ExperimentConfig", menuName = "VFS/Experiment Config")]
|
||||
public class ExperimentConfig : ScriptableObject
|
||||
{
|
||||
[Header("实验标识")]
|
||||
public ExperimentType Type;
|
||||
[Header("实验名称")]
|
||||
public string DisplayName;
|
||||
[Header("骨折固定专属 - 固定方式对应的步骤覆盖")]
|
||||
public FixationMethod DefaultFixationMethod = FixationMethod.LimbFixation;
|
||||
[Header("学习模式步骤列表(肢体固定)")]
|
||||
public StepData[] LearnStepsLimb;
|
||||
[Header("学习模式步骤列表(夹板固定)")]
|
||||
public StepData[] LearnStepsSplint;
|
||||
[Header("考核模式步骤列表(肢体固定)")]
|
||||
public StepData[] ExamStepsLimb;
|
||||
[Header("考核模式步骤列表(夹板固定)")]
|
||||
public StepData[] ExamStepsSplint;
|
||||
|
||||
public StepData[] GetStepsFor(ExperimentMode mode, FixationMethod fixation)
|
||||
{
|
||||
if (mode == ExperimentMode.Learn)
|
||||
return fixation == FixationMethod.SplintFixation ? LearnStepsSplint : LearnStepsLimb;
|
||||
else
|
||||
return fixation == FixationMethod.SplintFixation ? ExamStepsSplint : ExamStepsLimb;
|
||||
}
|
||||
|
||||
public int StepCount(ExperimentMode mode, FixationMethod fixation)
|
||||
{
|
||||
var steps = GetStepsFor(mode, fixation);
|
||||
return steps != null ? steps.Length : 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 24d3a8cba581943e1a2b2c167c7dd259
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,63 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 单个实验步骤的数据配置(ScriptableObject)。
|
||||
/// 在 Unity Editor 中为每个实验创建一份 StepData 列表。
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "StepData", menuName = "VFS/Step Data")]
|
||||
public class StepData : ScriptableObject
|
||||
{
|
||||
[Header("=== 评分 ===")]
|
||||
[Tooltip("本步骤满分(考核模式下使用,总分 100 分)")]
|
||||
[Range(0f, 100f)]
|
||||
public float ScoreWeight = 10f;
|
||||
|
||||
[Tooltip("本步骤的子项数量(如伤情检查有 5 个子项,用于 SequenceClick 按比例计分)")]
|
||||
public int SubStepCount = 1;
|
||||
|
||||
[Header("基础信息")]
|
||||
[Tooltip("步骤序号,从 0 开始")]
|
||||
public int StepIndex;
|
||||
|
||||
[Tooltip("步骤名称(内部标识)")]
|
||||
public string StepName;
|
||||
|
||||
[Header("学习模式文案")]
|
||||
[TextArea(2, 4)]
|
||||
public string TipText; // 顶部 Tip 提示框文案
|
||||
|
||||
[TextArea(2, 4)]
|
||||
public string DialogueText; // 角色对话气泡文案
|
||||
|
||||
[Header("学习模式 - 详细操作说明(甲方补充内容)")]
|
||||
[TextArea(3, 8)]
|
||||
public string DetailedContent; // 伤情检查/夹板固定等详细操作须知
|
||||
|
||||
[Header("考核模式文案")]
|
||||
[TextArea(2, 4)]
|
||||
public string ExamQuestionText; // 考核弹窗题目文案
|
||||
|
||||
[Header("考核选项")]
|
||||
public string[] ExamOptions; // 选择题选项(如 {"5cm", "10cm", "20cm"})
|
||||
public int CorrectOptionIndex; // 正确选项的索引(-1 表示非选择题)
|
||||
public string ErrorFeedback; // 答错时的反馈文案
|
||||
|
||||
[Header("交互配置")]
|
||||
public StepCompleteType CompleteType = StepCompleteType.ClickObject;
|
||||
|
||||
[Tooltip("交互目标的 Tag(如 InjuryLeg, Shoe, Bandage)")]
|
||||
public string TargetTag;
|
||||
|
||||
[Tooltip("考核模式点击顺序(SequenceClick 类型时使用)")]
|
||||
public string[] ClickSequenceTags;
|
||||
|
||||
[Header("额外配置")]
|
||||
[Tooltip("是否为夹板固定专属步骤")]
|
||||
public bool IsSplintOnly;
|
||||
|
||||
[Tooltip("是否需要播放画中画视频")]
|
||||
public bool ShowPipVideo;
|
||||
|
||||
[Tooltip("画中画视频文件名(StreamingAssets 下)")]
|
||||
public string VideoFileName;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dac314898f2b743efa29d166b0ed2980
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user