242 lines
7.1 KiB
C#
242 lines
7.1 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using Newtonsoft.Json;
|
||
|
||
namespace DefaultNamespace.ProcessMode
|
||
{
|
||
|
||
|
||
/// <summary>
|
||
/// 流程步骤数据
|
||
/// </summary>
|
||
[Serializable]
|
||
public class ProcessStepDto
|
||
{
|
||
/// <summary>
|
||
/// 步骤描述,说明当前步骤的主要内容和目的
|
||
/// </summary>
|
||
[JsonProperty("StepDescription")]
|
||
public string StepDescription { get; set; }
|
||
|
||
/// <summary>
|
||
/// 步骤中包含的所有动作列表
|
||
/// </summary>
|
||
[JsonProperty("Actions")]
|
||
public List<ProcessAction> Actions { get; set; }
|
||
|
||
/// <summary>
|
||
/// 步骤是否已完成
|
||
/// </summary>
|
||
[JsonProperty("IsCompleted")]
|
||
public bool IsCompleted { get; set; }
|
||
|
||
/// <summary>
|
||
/// 步骤编号,用于标识步骤的顺序
|
||
/// </summary>
|
||
[JsonProperty("StepNumber")]
|
||
public int StepNumber { get; set; }
|
||
|
||
/// <summary>
|
||
/// 步骤得分
|
||
/// </summary>
|
||
[JsonProperty("Score")]
|
||
public double Score { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 流程动作数据
|
||
/// </summary>
|
||
[Serializable]
|
||
public class ProcessAction
|
||
{
|
||
/// <summary>
|
||
/// 动作类型:0-点击物体,1-判断题,2-多选题
|
||
/// </summary>
|
||
[JsonProperty("ActionType")]
|
||
public int ActionType { get; set; }
|
||
|
||
/// <summary>
|
||
/// 判断题列表,包含多个判断题及其答案和分数
|
||
/// </summary>
|
||
[JsonProperty("JudgmentQuestions")]
|
||
public List<JudgmentQuestion> JudgmentQuestions { get; set; }
|
||
|
||
/// <summary>
|
||
/// 多选题列表,包含多个多选题及其选项、答案和分数
|
||
/// </summary>
|
||
[JsonProperty("MultipleChoiceQuestions")]
|
||
public List<MultipleChoiceQuestion> MultipleChoiceQuestions { get; set; }
|
||
|
||
/// <summary>
|
||
/// 动作标题,用于显示在界面上
|
||
/// </summary>
|
||
[JsonProperty("Title")]
|
||
public string Title { get; set; }
|
||
|
||
/// <summary>
|
||
/// 目标物体列表,包含需要交互的物体信息
|
||
/// </summary>
|
||
[JsonProperty("TargetObjects")]
|
||
public List<TargetObject> TargetObjects { get; set; }
|
||
|
||
/// <summary>
|
||
/// 动作描述,说明具体的操作要求
|
||
/// </summary>
|
||
[JsonProperty("Action")]
|
||
public string Action { get; set; }
|
||
|
||
/// <summary>
|
||
/// 动作的详细描述,包含更多操作细节
|
||
/// </summary>
|
||
[JsonProperty("Description")]
|
||
public string Description { get; set; }
|
||
|
||
/// <summary>
|
||
/// 是否按顺序执行,true表示必须按顺序完成所有目标物体
|
||
/// </summary>
|
||
[JsonProperty("IsSequential")]
|
||
public bool IsSequential { get; set; }
|
||
|
||
/// <summary>
|
||
/// 已点击的物体列表,记录用户已交互过的物体
|
||
/// </summary>
|
||
[JsonProperty("ClickedObjects")]
|
||
public List<string> ClickedObjects { get; set; }
|
||
|
||
/// <summary>
|
||
/// 当前目标物体的索引,用于顺序执行时追踪进度
|
||
/// </summary>
|
||
[JsonProperty("CurrentObjectIndex")]
|
||
public int CurrentObjectIndex { get; set; }
|
||
|
||
/// <summary>
|
||
/// 是否已显示反馈信息
|
||
/// </summary>
|
||
[JsonProperty("FeedbackDisplayed")]
|
||
public bool FeedbackDisplayed { get; set; }
|
||
|
||
/// <summary>
|
||
/// 步骤描述,与ProcessStep中的StepDescription相同
|
||
/// </summary>
|
||
[JsonProperty("StepDescription")]
|
||
public string StepDescription { get; set; }
|
||
|
||
/// <summary>
|
||
/// 动作的分数,完成该动作可获得的分值
|
||
/// </summary>
|
||
[JsonProperty("Score")]
|
||
public double Score { get; set; }
|
||
|
||
/// <summary>
|
||
/// 场景名称,如果需要切换场景则指定目标场景名
|
||
/// </summary>
|
||
[JsonProperty("SceneName")]
|
||
public string SceneName { get; set; }
|
||
|
||
/// <summary>
|
||
/// 是否需要切换场景
|
||
/// </summary>
|
||
[JsonProperty("RequiresSceneSwitch")]
|
||
public bool RequiresSceneSwitch { get; set; }
|
||
|
||
/// <summary>
|
||
/// 目标物体事件字典,记录每个目标物体需要触发的事件
|
||
/// </summary>
|
||
[JsonProperty("TargetObjectEvents")]
|
||
public Dictionary<string, object> TargetObjectEvents { get; set; }
|
||
|
||
/// <summary>
|
||
/// 流程步骤索引,标识当前动作属于哪个步骤
|
||
/// </summary>
|
||
[JsonProperty("ProcessStepIndex")]
|
||
public int ProcessStepIndex { get; set; }
|
||
|
||
/// <summary>
|
||
/// 是否需要正确完成,true表示必须完全正确才能通过
|
||
/// </summary>
|
||
[JsonProperty("RequireCorrectCompletion")]
|
||
public bool RequireCorrectCompletion { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 判断题数据
|
||
/// </summary>
|
||
[Serializable]
|
||
public class JudgmentQuestion
|
||
{
|
||
/// <summary>
|
||
/// 问题内容,描述需要判断的具体问题
|
||
/// </summary>
|
||
[JsonProperty("Question")]
|
||
public string Question { get; set; }
|
||
|
||
/// <summary>
|
||
/// 正确答案,用户需要输入的正确内容
|
||
/// </summary>
|
||
[JsonProperty("CorrectAnswer")]
|
||
public string CorrectAnswer { get; set; }
|
||
|
||
/// <summary>
|
||
/// 问题分值,答对可获得的分值
|
||
/// </summary>
|
||
[JsonProperty("Score")]
|
||
public double Score { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 多选题数据
|
||
/// </summary>
|
||
[Serializable]
|
||
public class MultipleChoiceQuestion
|
||
{
|
||
/// <summary>
|
||
/// 问题内容,描述需要选择的具体问题
|
||
/// </summary>
|
||
[JsonProperty("Question")]
|
||
public string Question { get; set; }
|
||
|
||
/// <summary>
|
||
/// 选项列表,包含所有可供选择的答案选项
|
||
/// </summary>
|
||
[JsonProperty("Options")]
|
||
public List<string> Options { get; set; }
|
||
|
||
/// <summary>
|
||
/// 正确答案列表,包含所有正确的选项
|
||
/// </summary>
|
||
[JsonProperty("CorrectAnswers")]
|
||
public List<string> CorrectAnswers { get; set; }
|
||
|
||
/// <summary>
|
||
/// 问题分值,答对可获得的分值
|
||
/// </summary>
|
||
[JsonProperty("Score")]
|
||
public double Score { get; set; }
|
||
}
|
||
|
||
/// <summary>
|
||
/// 目标物体数据
|
||
/// </summary>
|
||
[Serializable]
|
||
public class TargetObject
|
||
{
|
||
/// <summary>
|
||
/// 物体名称,用于在场景中识别物体
|
||
/// </summary>
|
||
[JsonProperty("ObjectName")]
|
||
public string ObjectName { get; set; }
|
||
|
||
/// <summary>
|
||
/// 物体类型,用于区分不同种类的物体
|
||
/// </summary>
|
||
[JsonProperty("Type")]
|
||
public int Type { get; set; }
|
||
|
||
/// <summary>
|
||
/// 物体分值,与该物体交互可获得的分值
|
||
/// </summary>
|
||
[JsonProperty("Score")]
|
||
public double Score { get; set; }
|
||
}
|
||
} |