no message
This commit is contained in:
parent
b947abeabb
commit
70bc621f79
|
@ -6,9 +6,15 @@
|
|||
<component name="ChangeListManager">
|
||||
<list default="true" id="4757d49c-0b49-4c70-aad5-a981aeb5a89d" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.UnityFramework/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.UnityFramework/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Logs/AssetImportWorker0-prev.log" beforeDir="false" afterPath="$PROJECT_DIR$/Logs/AssetImportWorker0-prev.log" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assembly-CSharp.csproj" beforeDir="false" afterPath="$PROJECT_DIR$/Assembly-CSharp.csproj" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Framework/Editor/ProcessScoreWindow.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Framework/Editor/ProcessScoreWindow.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Framework/Editor/SceneStepEditorWindow.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Framework/Editor/SceneStepEditorWindow.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Framework/GameLauncher.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Framework/GameLauncher.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Framework/Manager/ProcessManager.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Framework/Manager/ProcessManager.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/Framework/ProcessMode/ProcessStepDescription.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Framework/ProcessMode/ProcessStepDescription.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/StreamingAssets/DataConfig/新流程.json" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/StreamingAssets/DataConfig/新流程.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Assets/test.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/test.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Logs/AssetImportWorker0.log" beforeDir="false" afterPath="$PROJECT_DIR$/Logs/AssetImportWorker0.log" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Logs/AssetImportWorker1-prev.log" beforeDir="false" afterPath="$PROJECT_DIR$/Logs/AssetImportWorker1-prev.log" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Logs/AssetImportWorker1.log" beforeDir="false" afterPath="$PROJECT_DIR$/Logs/AssetImportWorker1.log" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -68,13 +74,15 @@
|
|||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
<configuration name="附加到 Unity 编辑器" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost">
|
||||
<configuration name="附加到 Unity 编辑器" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost" ignored-value-for-modified-check="8716">
|
||||
<option name="allowRunningInParallel" value="false" />
|
||||
<option name="listenPortForConnections" value="false" />
|
||||
<option name="pid" />
|
||||
<option name="pid" value="8716" />
|
||||
<option name="projectPathOnTarget" />
|
||||
<option name="runtimes">
|
||||
<list />
|
||||
<list>
|
||||
<MonoRuntime />
|
||||
</list>
|
||||
</option>
|
||||
<option name="selectedOptions">
|
||||
<list />
|
||||
|
@ -115,7 +123,7 @@
|
|||
<workItem from="1735526177401" duration="1937000" />
|
||||
<workItem from="1741929920711" duration="1512000" />
|
||||
<workItem from="1741931990332" duration="24000" />
|
||||
<workItem from="1742776022876" duration="16557000" />
|
||||
<workItem from="1742776022876" duration="28367000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
@ -132,49 +140,4 @@
|
|||
<component name="VcsManagerConfiguration">
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" type="DotNet Breakpoints">
|
||||
<url>file://$PROJECT_DIR$/Assets/Framework/Manager/ProcessManager.cs</url>
|
||||
<line>185</line>
|
||||
<properties documentPath="E:\Unity Projects\GitLab\2024\UnityFramework\Assets\Framework\Manager\ProcessManager.cs" containingFunctionPresentation="方法 'HandleClick'">
|
||||
<startOffsets>
|
||||
<option value="5411" />
|
||||
</startOffsets>
|
||||
<endOffsets>
|
||||
<option value="5449" />
|
||||
</endOffsets>
|
||||
</properties>
|
||||
<option name="timeStamp" value="1" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="DotNet Breakpoints">
|
||||
<url>file://$PROJECT_DIR$/Assets/Framework/Manager/ProcessManager.cs</url>
|
||||
<line>270</line>
|
||||
<properties documentPath="E:\Unity Projects\GitLab\2024\UnityFramework\Assets\Framework\Manager\ProcessManager.cs" containingFunctionPresentation="方法 'HandleNonSequentialClick'">
|
||||
<startOffsets>
|
||||
<option value="8855" />
|
||||
</startOffsets>
|
||||
<endOffsets>
|
||||
<option value="8931" />
|
||||
</endOffsets>
|
||||
</properties>
|
||||
<option name="timeStamp" value="3" />
|
||||
</line-breakpoint>
|
||||
<line-breakpoint enabled="true" type="DotNet Breakpoints">
|
||||
<url>file://$PROJECT_DIR$/Assets/Framework/Manager/ProcessManager.cs</url>
|
||||
<line>625</line>
|
||||
<properties documentPath="E:\Unity Projects\GitLab\2024\UnityFramework\Assets\Framework\Manager\ProcessManager.cs" containingFunctionPresentation="方法 'AddIncorrectClick'">
|
||||
<startOffsets>
|
||||
<option value="20573" />
|
||||
</startOffsets>
|
||||
<endOffsets>
|
||||
<option value="20627" />
|
||||
</endOffsets>
|
||||
</properties>
|
||||
<option name="timeStamp" value="4" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
</component>
|
||||
</project>
|
|
@ -56,6 +56,7 @@
|
|||
<Compile Include="Assets\TestScripts\DoTweenTest\DoTweenTest.cs" />
|
||||
<Compile Include="Assets\Framework\Test\TestProcess.cs" />
|
||||
<Compile Include="Assets\Framework\ProcessExecutor.cs" />
|
||||
<Compile Include="Assets\测试_ProcessEvents.cs" />
|
||||
<Compile Include="Assets\Framework\Test\ProcessTest.cs" />
|
||||
<Compile Include="Assets\Framework\ProcessMode\ProcessMode.cs" />
|
||||
<Compile Include="Assets\Framework\Dto\SubmitScoreDto.cs" />
|
||||
|
@ -72,6 +73,7 @@
|
|||
<Compile Include="Assets\TestScripts\JsonTest\JsonTest.cs" />
|
||||
<Compile Include="Assets\Framework\Dto\SceneInformation.cs" />
|
||||
<None Include="E:\com.unity.ide.cursor-master\package.json" />
|
||||
<None Include="Assets\StreamingAssets\DataConfig\测试.json" />
|
||||
<None Include="Assets\StreamingAssets\DataConfig\新流程.json" />
|
||||
<None Include="E:\com.unity.ide.cursor-master\ValidationExceptions.json" />
|
||||
<None Include="Assets\StreamingAssets\data\config.json" />
|
||||
|
|
|
@ -133,23 +133,42 @@ public class ProcessScoreWindow : EditorWindow
|
|||
// 显示错误点击信息
|
||||
if (processManager._incorrectClicksPerStep.TryGetValue(i, out var incorrectClicks))
|
||||
{
|
||||
EditorGUILayout.LabelField("错误点击:", warningStyle);
|
||||
EditorGUILayout.LabelField($"次数: {incorrectClicks.Count}");
|
||||
EditorGUILayout.LabelField($"物体: {string.Join(", ", incorrectClicks)}");
|
||||
|
||||
float scorePerObject = action.Score / action.TargetObjects.Count;
|
||||
float deductedScore = action.Score - scorePerObject * incorrectClicks.Count;
|
||||
deductedScore = Mathf.Max(0, deductedScore);
|
||||
|
||||
EditorGUILayout.LabelField($"实际得分: {deductedScore:F2}/{action.Score}");
|
||||
}
|
||||
else if (step.IsCompleted)
|
||||
{
|
||||
EditorGUILayout.LabelField($"实际得分: {action.Score}/{action.Score} (完美完成)");
|
||||
// 只显示当前动作的错误点击
|
||||
var currentActionErrors = incorrectClicks
|
||||
.Where(error => action.TargetObjects.Any(target => target.ObjectName == error))
|
||||
.ToList();
|
||||
|
||||
if (currentActionErrors.Count > 0)
|
||||
{
|
||||
EditorGUILayout.LabelField("错误点击:", warningStyle);
|
||||
EditorGUILayout.LabelField($"次数: {currentActionErrors.Count}");
|
||||
EditorGUILayout.LabelField($"物体: {string.Join(", ", currentActionErrors)}");
|
||||
|
||||
float scorePerObject = action.Score / action.TargetObjects.Count;
|
||||
float deductedScore = action.Score - scorePerObject * currentActionErrors.Count;
|
||||
deductedScore = Mathf.Max(0, deductedScore);
|
||||
|
||||
EditorGUILayout.LabelField($"实际得分: {deductedScore:F2}/{action.Score}");
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.LabelField($"实际得分: {action.Score}/{action.Score} (完美完成)");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.LabelField($"实际得分: 0/{action.Score} (未完成)", warningStyle);
|
||||
// 添加调试信息
|
||||
EditorGUILayout.LabelField($"当前索引: {action.CurrentObjectIndex}");
|
||||
EditorGUILayout.LabelField($"目标数量: {action.TargetObjects.Count}");
|
||||
|
||||
if (action.CurrentObjectIndex >= action.TargetObjects.Count)
|
||||
{
|
||||
EditorGUILayout.LabelField($"实际得分: {action.Score}/{action.Score} (完美完成)");
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.LabelField($"实际得分: 0/{action.Score} (未完成)", warningStyle);
|
||||
}
|
||||
}
|
||||
|
||||
EditorGUILayout.EndVertical();
|
||||
|
|
|
@ -297,11 +297,42 @@ namespace DefaultNamespace.ProcessMode
|
|||
|
||||
if (!saveConfirmed) return;
|
||||
|
||||
// 在序列化之前,根据动作类型清理不需要的数据
|
||||
foreach (var step in steps)
|
||||
{
|
||||
foreach (var action in step.Actions)
|
||||
{
|
||||
if (action.ActionType == ProcessActionType.默认)
|
||||
{
|
||||
// 如果是默认类型,清除判断题和多选题数据
|
||||
action.JudgmentQuestions = null;
|
||||
action.MultipleChoiceQuestions = null;
|
||||
}
|
||||
else if (action.ActionType == ProcessActionType.选择题)
|
||||
{
|
||||
// 如果是判断题类型,清除目标对象和多选题数据
|
||||
action.TargetObjects = new List<(string ObjectName, ProcessTargetType Type)>();
|
||||
action.MultipleChoiceQuestions = null;
|
||||
action.IsSequential = false;
|
||||
}
|
||||
else if (action.ActionType == ProcessActionType.多选题)
|
||||
{
|
||||
// 如果是多选题类型,清除目标对象和判断题数据
|
||||
action.TargetObjects = new List<(string ObjectName, ProcessTargetType Type)>();
|
||||
action.JudgmentQuestions = null;
|
||||
action.IsSequential = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 保存 JSON 数据
|
||||
string json = JsonConvert.SerializeObject(steps, Formatting.Indented);
|
||||
File.WriteAllText(configFilePath, json);
|
||||
|
||||
EditorUtility.DisplayDialog("保存成功", "配置已保存到 " + selectedFileName, "确定");
|
||||
|
||||
// 重新加载文件以刷新界面
|
||||
LoadProcessFile();
|
||||
}
|
||||
|
||||
private void DrawSaveButton()
|
||||
|
@ -359,12 +390,36 @@ namespace DefaultNamespace.ProcessMode
|
|||
{
|
||||
action.Title = EditorGUILayout.TextField("标题", action.Title);
|
||||
action.Description = EditorGUILayout.TextField("描述", action.Description);
|
||||
action.IsSequential = EditorGUILayout.Toggle("按顺序点击", action.IsSequential);
|
||||
action.Score = EditorGUILayout.FloatField("分数", action.Score);
|
||||
action.RequireCorrectCompletion = EditorGUILayout.Toggle("需要正确完成", action.RequireCorrectCompletion);
|
||||
|
||||
// 添加动作类型选择
|
||||
action.ActionType = (ProcessActionType)EditorGUILayout.EnumPopup("动作类型", action.ActionType);
|
||||
|
||||
GUILayout.Space(5);
|
||||
DrawTargetObjects(action);
|
||||
// 根据动作类型显示不同的配置界面
|
||||
if (action.ActionType == ProcessActionType.默认)
|
||||
{
|
||||
action.IsSequential = EditorGUILayout.Toggle("按顺序点击", action.IsSequential);
|
||||
action.Score = EditorGUILayout.FloatField("分数", action.Score);
|
||||
action.RequireCorrectCompletion = EditorGUILayout.Toggle("需要正确完成", action.RequireCorrectCompletion);
|
||||
|
||||
GUILayout.Space(5);
|
||||
DrawTargetObjects(action);
|
||||
}
|
||||
else if (action.ActionType == ProcessActionType.选择题)
|
||||
{
|
||||
action.Score = EditorGUILayout.FloatField("分数", action.Score);
|
||||
action.RequireCorrectCompletion = EditorGUILayout.Toggle("需要正确完成", action.RequireCorrectCompletion);
|
||||
|
||||
GUILayout.Space(10);
|
||||
DrawJudgmentQuestions(action);
|
||||
}
|
||||
else if (action.ActionType == ProcessActionType.多选题)
|
||||
{
|
||||
action.Score = EditorGUILayout.FloatField("分数", action.Score);
|
||||
action.RequireCorrectCompletion = EditorGUILayout.Toggle("需要正确完成", action.RequireCorrectCompletion);
|
||||
|
||||
GUILayout.Space(10);
|
||||
DrawMultipleChoiceQuestions(action);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawTargetObjects(ProcessStepDescription action)
|
||||
|
@ -403,6 +458,155 @@ namespace DefaultNamespace.ProcessMode
|
|||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void DrawJudgmentQuestions(ProcessStepDescription action)
|
||||
{
|
||||
GUILayout.Label("判断题配置", EditorStyles.boldLabel);
|
||||
|
||||
// 确保 JudgmentQuestions 列表已初始化
|
||||
if (action.JudgmentQuestions == null)
|
||||
{
|
||||
action.JudgmentQuestions = new List<JudgmentQuestionConfig>();
|
||||
}
|
||||
|
||||
// 显示所有判断题
|
||||
for (int i = 0; i < action.JudgmentQuestions.Count; i++)
|
||||
{
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label($"题目 {i + 1}", EditorStyles.boldLabel);
|
||||
|
||||
// 删除按钮
|
||||
if (GUILayout.Button("-", GUILayout.Width(30)))
|
||||
{
|
||||
action.JudgmentQuestions.RemoveAt(i);
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.EndVertical();
|
||||
continue;
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.Space(5);
|
||||
|
||||
// 题目输入
|
||||
action.JudgmentQuestions[i].Question = EditorGUILayout.TextField("题目内容", action.JudgmentQuestions[i].Question);
|
||||
|
||||
// 正确答案输入框
|
||||
action.JudgmentQuestions[i].CorrectAnswer = EditorGUILayout.TextField("正确答案", action.JudgmentQuestions[i].CorrectAnswer);
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(5);
|
||||
}
|
||||
|
||||
// 添加新题目按钮
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
if (GUILayout.Button("添加判断题", GUILayout.Width(300)))
|
||||
{
|
||||
action.JudgmentQuestions.Add(new JudgmentQuestionConfig
|
||||
{
|
||||
Question = "",
|
||||
CorrectAnswer = ""
|
||||
});
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void DrawMultipleChoiceQuestions(ProcessStepDescription action)
|
||||
{
|
||||
GUILayout.Label("多选题配置", EditorStyles.boldLabel);
|
||||
|
||||
// 确保 MultipleChoiceQuestions 列表已初始化
|
||||
if (action.MultipleChoiceQuestions == null)
|
||||
{
|
||||
action.MultipleChoiceQuestions = new List<MultipleChoiceConfig>();
|
||||
}
|
||||
|
||||
// 显示所有多选题
|
||||
for (int i = 0; i < action.MultipleChoiceQuestions.Count; i++)
|
||||
{
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label($"题目 {i + 1}", EditorStyles.boldLabel);
|
||||
|
||||
// 删除按钮
|
||||
if (GUILayout.Button("-", GUILayout.Width(30)))
|
||||
{
|
||||
action.MultipleChoiceQuestions.RemoveAt(i);
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.EndVertical();
|
||||
continue;
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.Space(5);
|
||||
|
||||
// 题目输入
|
||||
action.MultipleChoiceQuestions[i].Question = EditorGUILayout.TextField("题目内容", action.MultipleChoiceQuestions[i].Question);
|
||||
|
||||
// 选项列表
|
||||
GUILayout.Label("选项列表", EditorStyles.boldLabel);
|
||||
for (int j = 0; j < action.MultipleChoiceQuestions[i].Options.Count; j++)
|
||||
{
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
// 选项内容
|
||||
action.MultipleChoiceQuestions[i].Options[j] = EditorGUILayout.TextField($"选项 {j + 1}", action.MultipleChoiceQuestions[i].Options[j]);
|
||||
|
||||
// 是否为正确答案
|
||||
bool isCorrect = action.MultipleChoiceQuestions[i].CorrectAnswers.Contains(action.MultipleChoiceQuestions[i].Options[j]);
|
||||
bool newIsCorrect = EditorGUILayout.Toggle("是正确答案", isCorrect, GUILayout.Width(100));
|
||||
|
||||
if (newIsCorrect != isCorrect)
|
||||
{
|
||||
if (newIsCorrect)
|
||||
{
|
||||
if (!action.MultipleChoiceQuestions[i].CorrectAnswers.Contains(action.MultipleChoiceQuestions[i].Options[j]))
|
||||
{
|
||||
action.MultipleChoiceQuestions[i].CorrectAnswers.Add(action.MultipleChoiceQuestions[i].Options[j]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
action.MultipleChoiceQuestions[i].CorrectAnswers.Remove(action.MultipleChoiceQuestions[i].Options[j]);
|
||||
}
|
||||
}
|
||||
|
||||
// 删除选项按钮
|
||||
if (GUILayout.Button("-", GUILayout.Width(30)))
|
||||
{
|
||||
action.MultipleChoiceQuestions[i].Options.RemoveAt(j);
|
||||
action.MultipleChoiceQuestions[i].CorrectAnswers.Remove(action.MultipleChoiceQuestions[i].Options[j]);
|
||||
GUILayout.EndHorizontal();
|
||||
continue;
|
||||
}
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
// 添加选项按钮
|
||||
if (GUILayout.Button("添加选项", GUILayout.Width(100)))
|
||||
{
|
||||
action.MultipleChoiceQuestions[i].Options.Add("");
|
||||
}
|
||||
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.Space(5);
|
||||
}
|
||||
|
||||
// 添加新题目按钮
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.FlexibleSpace();
|
||||
if (GUILayout.Button("添加多选题", GUILayout.Width(300)))
|
||||
{
|
||||
action.MultipleChoiceQuestions.Add(new MultipleChoiceConfig());
|
||||
}
|
||||
GUILayout.FlexibleSpace();
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void AddNewStep()
|
||||
{
|
||||
steps.Add(new ProcessStep("新步骤", new List<ProcessStepDescription>()));
|
||||
|
|
|
@ -65,7 +65,7 @@ public class GameLauncher : MonoBehaviour
|
|||
|
||||
|
||||
MotionEngine.GetModule<ProcessManager>().InitializeFirstStep(
|
||||
System.IO.File.ReadAllText(Application.streamingAssetsPath + "/DataConfig/新流程.json"),
|
||||
System.IO.File.ReadAllText(Application.streamingAssetsPath + "/DataConfig/测试.json"),
|
||||
ProcessMode.Teaching);
|
||||
|
||||
// //获取所有ProcessAction 属性
|
||||
|
|
|
@ -177,6 +177,129 @@ namespace DefaultNamespace.ProcessMode
|
|||
|
||||
#region 点击处理逻辑
|
||||
|
||||
/// <summary>
|
||||
/// 处理点击事件 - 多选题答案集合版本
|
||||
/// </summary>
|
||||
public bool HandleClick(List<string> selectedAnswers)
|
||||
{
|
||||
string type = _currentMode.ToString();
|
||||
|
||||
if (!_processes.ContainsKey(type)) return false;
|
||||
|
||||
ProcessCollection processCollection = _processes[type];
|
||||
if (_currentStepIndex >= processCollection.Steps.Count) return false;
|
||||
|
||||
ProcessStep step = processCollection.Steps[_currentStepIndex];
|
||||
ProcessStepDescription currentAction = step.Actions[_currentActionIndex];
|
||||
|
||||
// 只处理多选题类型
|
||||
if (currentAction.ActionType != ProcessActionType.多选题)
|
||||
{
|
||||
Debug.LogWarning("当前动作不是多选题类型!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 确保有多选题配置
|
||||
if (currentAction.MultipleChoiceQuestions == null || currentAction.MultipleChoiceQuestions.Count == 0)
|
||||
{
|
||||
Debug.LogWarning("当前动作没有配置多选题!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 获取当前要回答的多选题
|
||||
if (currentAction.CurrentObjectIndex >= currentAction.MultipleChoiceQuestions.Count)
|
||||
{
|
||||
Debug.LogWarning("已经回答完所有多选题!");
|
||||
return false;
|
||||
}
|
||||
|
||||
var currentQuestion = currentAction.MultipleChoiceQuestions[currentAction.CurrentObjectIndex];
|
||||
|
||||
// 检查答案正确性
|
||||
var correctAnswers = currentQuestion.Options; // 直接使用选项列表作为正确答案
|
||||
var selectedAnswersSet = new HashSet<string>(selectedAnswers);
|
||||
var correctAnswersSet = new HashSet<string>(correctAnswers);
|
||||
|
||||
// 找出未选择的正确答案(算作错误)
|
||||
var unselectedCorrectAnswers = correctAnswersSet.Where(correct => !selectedAnswersSet.Contains(correct)).ToList();
|
||||
|
||||
// 找出多选的错误答案
|
||||
var extraWrongAnswers = selectedAnswersSet.Where(selected => !correctAnswersSet.Contains(selected)).ToList();
|
||||
|
||||
// 计算错误答案总数
|
||||
int wrongAnswersCount = unselectedCorrectAnswers.Count + extraWrongAnswers.Count;
|
||||
|
||||
// 只有当没有错误答案时才算正确
|
||||
bool isCorrect = wrongAnswersCount == 0;
|
||||
|
||||
// 记录用户的选择
|
||||
currentAction.ClickedObjects.Clear();
|
||||
currentAction.ClickedObjects.AddRange(selectedAnswers);
|
||||
|
||||
if (isCorrect)
|
||||
{
|
||||
Debug.Log($"回答正确!问题:{currentQuestion.Question}");
|
||||
Debug.Log($"选择的答案:{string.Join(", ", selectedAnswers)}");
|
||||
Debug.Log($"正确答案:{string.Join(", ", correctAnswers)}");
|
||||
currentAction.CurrentObjectIndex++; // 移动到下一题
|
||||
currentAction.ClickedObjects.Clear(); // 清空选择,准备下一题
|
||||
|
||||
// 如果所有题目都回答完了
|
||||
if (currentAction.CurrentObjectIndex >= currentAction.MultipleChoiceQuestions.Count)
|
||||
{
|
||||
CompleteAction(step, currentAction);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 记录错误信息
|
||||
Debug.Log($"回答错误!问题:{currentQuestion.Question}");
|
||||
Debug.Log($"选择的答案:{string.Join(", ", selectedAnswers)}");
|
||||
Debug.Log($"正确答案:{string.Join(", ", correctAnswers)}");
|
||||
|
||||
// 记录未选择的正确答案
|
||||
foreach (var unselectedAnswer in unselectedCorrectAnswers)
|
||||
{
|
||||
Debug.Log($"未选择正确答案:{unselectedAnswer}");
|
||||
OnStepProcessDescriptionMessage?.Invoke($"<color=red>未选择正确答案:{unselectedAnswer}</color>");
|
||||
AddIncorrectClick(_currentStepIndex, unselectedAnswer);
|
||||
}
|
||||
|
||||
// 记录多选的错误答案
|
||||
foreach (var extraAnswer in extraWrongAnswers)
|
||||
{
|
||||
Debug.Log($"多选错误答案:{extraAnswer}");
|
||||
OnStepProcessDescriptionMessage?.Invoke($"<color=red>多选错误答案:{extraAnswer}</color>");
|
||||
AddIncorrectClick(_currentStepIndex, extraAnswer);
|
||||
}
|
||||
|
||||
OnStepProcessDescriptionMessage?.Invoke($"<color=red>回答错误</color>,正确答案:{string.Join(", ", correctAnswers)}");
|
||||
|
||||
// 如果不要求正确完成,且在练习或考核模式下
|
||||
if (!currentAction.RequireCorrectCompletion && IsInPracticeOrAssessment())
|
||||
{
|
||||
currentAction.CurrentObjectIndex++;
|
||||
currentAction.ClickedObjects.Clear();
|
||||
|
||||
if (currentAction.CurrentObjectIndex >= currentAction.MultipleChoiceQuestions.Count)
|
||||
{
|
||||
CompleteAction(step, currentAction);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (currentAction.RequireCorrectCompletion)
|
||||
{
|
||||
// 如果要求正确完成,清空当前作答记录,重新开始当前题目
|
||||
currentAction.ClickedObjects.Clear();
|
||||
OnStepProcessDescriptionMessage?.Invoke($"<color=red>需要正确完成此题</color>,请重新作答");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理点击事件
|
||||
/// </summary>
|
||||
|
@ -193,7 +316,93 @@ namespace DefaultNamespace.ProcessMode
|
|||
ProcessStep step = processCollection.Steps[_currentStepIndex];
|
||||
ProcessStepDescription currentAction = step.Actions[_currentActionIndex];
|
||||
|
||||
return HandleOtherModeClick(step, currentAction, clickedObject);
|
||||
// 根据动作类型进行不同的处理
|
||||
if (currentAction.ActionType == ProcessActionType.默认)
|
||||
{
|
||||
return HandleOtherModeClick(step, currentAction, clickedObject);
|
||||
}
|
||||
else if (currentAction.ActionType == ProcessActionType.选择题)
|
||||
{
|
||||
return HandleJudgmentQuestionClick(step, currentAction, clickedObject);
|
||||
}
|
||||
else if (currentAction.ActionType == ProcessActionType.多选题)
|
||||
{
|
||||
// 对于多选题,如果是单个点击,添加或移除选项
|
||||
if (!currentAction.ClickedObjects.Contains(clickedObject))
|
||||
{
|
||||
currentAction.ClickedObjects.Add(clickedObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
currentAction.ClickedObjects.Remove(clickedObject);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 处理判断题类型的点击
|
||||
/// </summary>
|
||||
private bool HandleJudgmentQuestionClick(ProcessStep step, ProcessStepDescription currentAction, string userAnswer)
|
||||
{
|
||||
// 确保有判断题配置
|
||||
if (currentAction.JudgmentQuestions == null || currentAction.JudgmentQuestions.Count == 0)
|
||||
{
|
||||
Debug.LogWarning("当前动作没有配置判断题!");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 获取当前要回答的判断题
|
||||
if (currentAction.CurrentObjectIndex >= currentAction.JudgmentQuestions.Count)
|
||||
{
|
||||
Debug.LogWarning("已经回答完所有判断题!");
|
||||
return false;
|
||||
}
|
||||
|
||||
var currentQuestion = currentAction.JudgmentQuestions[currentAction.CurrentObjectIndex];
|
||||
bool isCorrect = currentQuestion.CorrectAnswer == userAnswer;
|
||||
|
||||
if (isCorrect)
|
||||
{
|
||||
Debug.Log($"回答正确!问题:{currentQuestion.Question},答案:{userAnswer}");
|
||||
currentAction.ClickedObjects.Add(userAnswer); // 记录已回答
|
||||
currentAction.CurrentObjectIndex++; // 移动到下一题
|
||||
|
||||
// 如果所有题目都回答完了
|
||||
if (currentAction.CurrentObjectIndex >= currentAction.JudgmentQuestions.Count)
|
||||
{
|
||||
CompleteAction(step, currentAction);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"回答错误!问题:{currentQuestion.Question},你的答案:{userAnswer},正确答案:{currentQuestion.CorrectAnswer}");
|
||||
OnStepProcessDescriptionMessage?.Invoke($"<color=red>回答错误</color>,正确答案:{currentQuestion.CorrectAnswer}");
|
||||
AddIncorrectClick(_currentStepIndex, userAnswer);
|
||||
|
||||
// 如果不要求正确完成,且在练习或考核模式下
|
||||
if (!currentAction.RequireCorrectCompletion && IsInPracticeOrAssessment())
|
||||
{
|
||||
currentAction.ClickedObjects.Add(userAnswer);
|
||||
currentAction.CurrentObjectIndex++;
|
||||
|
||||
if (currentAction.CurrentObjectIndex >= currentAction.JudgmentQuestions.Count)
|
||||
{
|
||||
CompleteAction(step, currentAction);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (currentAction.RequireCorrectCompletion)
|
||||
{
|
||||
// 如果要求正确完成,清空当前作答记录,重新开始当前题目
|
||||
currentAction.ClickedObjects.Clear();
|
||||
OnStepProcessDescriptionMessage?.Invoke($"<color=red>需要正确完成此题</color>,请重新作答");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -320,8 +529,11 @@ namespace DefaultNamespace.ProcessMode
|
|||
currentAction.ClickedObjects.Add(clickedObject);
|
||||
currentAction.CurrentObjectIndex++;
|
||||
|
||||
Debug.Log($"当前动作进度:{currentAction.CurrentObjectIndex}/{currentAction.TargetObjects.Count}");
|
||||
|
||||
if (currentAction.CurrentObjectIndex >= currentAction.TargetObjects.Count)
|
||||
{
|
||||
Debug.Log($"动作完成!当前索引:{currentAction.CurrentObjectIndex},目标数量:{currentAction.TargetObjects.Count}");
|
||||
CompleteAction(step, currentAction);
|
||||
}
|
||||
else
|
||||
|
@ -723,11 +935,7 @@ namespace DefaultNamespace.ProcessMode
|
|||
for (int i = 0; i < steps.Count; i++)
|
||||
{
|
||||
var step = steps[i];
|
||||
float stepPossibleScore = 0; // 步骤满分
|
||||
float stepActualScore = 0; // 步骤实际得分
|
||||
|
||||
Debug.Log($"\n===== 步骤 {i + 1}: {step.StepDescription} =====");
|
||||
Debug.Log($"完成状态: {(step.IsCompleted ? "已完成" : "未完成")}");
|
||||
|
||||
// 遍历步骤中的所有动作
|
||||
for (int j = 0; j < step.Actions.Count; j++)
|
||||
|
@ -737,72 +945,51 @@ namespace DefaultNamespace.ProcessMode
|
|||
Debug.Log($"描述: {action.Description}");
|
||||
Debug.Log($"满分: {action.Score}");
|
||||
|
||||
// 列出所有目标物体
|
||||
Debug.Log("目标物体:");
|
||||
foreach (var target in action.TargetObjects)
|
||||
// 计算动作得分
|
||||
float actionScore = 0;
|
||||
|
||||
// 检查当前动作是否有错误点击
|
||||
var currentActionErrors = _incorrectClicksPerStep
|
||||
.Where(kvp => kvp.Key == i)
|
||||
.SelectMany(kvp => kvp.Value)
|
||||
.ToList();
|
||||
|
||||
// 如果动作已完成(所有目标都已点击)
|
||||
if (action.CurrentObjectIndex >= action.TargetObjects.Count)
|
||||
{
|
||||
Debug.Log($"- {target.ObjectName} (类型: {target.Type})");
|
||||
// 如果没有错误点击,得满分
|
||||
if (currentActionErrors.Count == 0)
|
||||
{
|
||||
actionScore = action.Score;
|
||||
Debug.Log($"动作完成且无错误,得满分:{actionScore}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// 有错误点击,计算扣分
|
||||
float scorePerError = action.Score / action.TargetObjects.Count;
|
||||
float deductedScore = scorePerError * currentActionErrors.Count;
|
||||
actionScore = Math.Max(0, action.Score - deductedScore);
|
||||
|
||||
Debug.Log($"动作完成但有错误:");
|
||||
Debug.Log($"错误点击次数: {currentActionErrors.Count}");
|
||||
Debug.Log($"错误点击的物体: {string.Join(", ", currentActionErrors)}");
|
||||
Debug.Log($"每个错误扣分: {scorePerError}");
|
||||
Debug.Log($"总扣分: {deductedScore}");
|
||||
Debug.Log($"实际得分: {actionScore}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 动作未完成,得分为0
|
||||
Debug.Log($"动作未完成,得分为0");
|
||||
}
|
||||
|
||||
stepPossibleScore += action.Score;
|
||||
|
||||
// 如果步骤未完成
|
||||
if (!step.IsCompleted)
|
||||
{
|
||||
Debug.Log($"实际得分: 0 (未完成)");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 如果有错误点击
|
||||
if (_incorrectClicksPerStep.TryGetValue(i, out var incorrectClicks))
|
||||
{
|
||||
float scorePerObject = action.Score / action.TargetObjects.Count;
|
||||
float deductedScore = action.Score - scorePerObject * incorrectClicks.Count;
|
||||
deductedScore = Math.Max(0, deductedScore);
|
||||
|
||||
Debug.Log($"错误点击次数: {incorrectClicks.Count}");
|
||||
Debug.Log($"错误点击的物体: {string.Join(", ", incorrectClicks)}");
|
||||
Debug.Log($"扣除分数: {(action.Score - deductedScore):F2}");
|
||||
Debug.Log($"实际得分: {deductedScore:F2}");
|
||||
|
||||
stepActualScore += deductedScore;
|
||||
}
|
||||
else // 无错误完成
|
||||
{
|
||||
Debug.Log($"实际得分: {action.Score} (完美完成)");
|
||||
stepActualScore += action.Score;
|
||||
}
|
||||
}
|
||||
|
||||
totalScore += stepActualScore;
|
||||
|
||||
// 记录评分步骤
|
||||
if (_currentMode == ProcessMode.Assessment)
|
||||
{
|
||||
_submitScoreSteps.Add(new SubmitScoreStep
|
||||
{
|
||||
stepName = step.StepDescription,
|
||||
testPoint = step.Actions[0].Description,
|
||||
setScore = (int)stepPossibleScore,
|
||||
score = (int)stepActualScore
|
||||
});
|
||||
}
|
||||
|
||||
Debug.Log($"\n----- 步骤 {i + 1} 总结 -----");
|
||||
Debug.Log($"步骤名称: {step.StepDescription}");
|
||||
Debug.Log($"动作数量: {step.Actions.Count}");
|
||||
Debug.Log($"满分: {stepPossibleScore:F2}");
|
||||
Debug.Log($"实际得分: {stepActualScore:F2}");
|
||||
Debug.Log($"完成状态: {(step.IsCompleted ? "已完成" : "未完成")}");
|
||||
if (_incorrectClicksPerStep.ContainsKey(i))
|
||||
{
|
||||
Debug.Log($"错误点击次数: {_incorrectClicksPerStep[i].Count}");
|
||||
totalScore += actionScore;
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log("\n========== 评分总结 ==========");
|
||||
Debug.Log($"总分: {totalScore:F2}");
|
||||
Debug.Log($"完成步骤数: {steps.Count(s => s.IsCompleted)}/{steps.Count}");
|
||||
Debug.Log($"有错误步骤数: {_incorrectClicksPerStep.Count}");
|
||||
Debug.Log("============================\n");
|
||||
|
||||
|
|
|
@ -6,6 +6,41 @@ using UnityEngine.Events;
|
|||
|
||||
namespace Framework.ProcessMode
|
||||
{
|
||||
/// <summary>
|
||||
/// 动作类型枚举
|
||||
/// </summary>
|
||||
public enum ProcessActionType
|
||||
{
|
||||
默认, // 默认类型
|
||||
选择题, // 判断题类型
|
||||
多选题 // 多选题类型
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断题配置
|
||||
/// </summary>
|
||||
public class JudgmentQuestionConfig
|
||||
{
|
||||
public string Question { get; set; } // 题目
|
||||
public string CorrectAnswer { get; set; } // 正确答案
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 多选题配置
|
||||
/// </summary>
|
||||
public class MultipleChoiceConfig
|
||||
{
|
||||
public string Question { get; set; } // 题目
|
||||
public List<string> Options { get; set; } // 选项列表
|
||||
public List<string> CorrectAnswers { get; set; } // 正确答案列表(可以多选)
|
||||
|
||||
public MultipleChoiceConfig()
|
||||
{
|
||||
Options = new List<string>();
|
||||
CorrectAnswers = new List<string>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 流程步骤描述类
|
||||
/// </summary>
|
||||
|
@ -17,6 +52,21 @@ namespace Framework.ProcessMode
|
|||
|
||||
public class ProcessStepDescription
|
||||
{
|
||||
/// <summary>
|
||||
/// 动作类型
|
||||
/// </summary>
|
||||
public ProcessActionType ActionType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 判断题配置列表
|
||||
/// </summary>
|
||||
public List<JudgmentQuestionConfig> JudgmentQuestions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 多选题配置列表
|
||||
/// </summary>
|
||||
public List<MultipleChoiceConfig> MultipleChoiceQuestions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 动作标题,用于对动作的简单描述
|
||||
/// </summary>
|
||||
|
@ -96,7 +146,7 @@ namespace Framework.ProcessMode
|
|||
/// <param name="title">动作标题</param>
|
||||
public ProcessStepDescription(List<(string ObjectName, ProcessTargetType Type)> targetObjects, Action action, string description, bool isSequential, string stepDescription, float score = 0, string title = "新动作")
|
||||
{
|
||||
Title = title; // 动作标题
|
||||
Title = title;
|
||||
TargetObjects = targetObjects ?? new List<(string, ProcessTargetType)>();
|
||||
Action = action;
|
||||
Description = description;
|
||||
|
@ -106,9 +156,13 @@ namespace Framework.ProcessMode
|
|||
FeedbackDisplayed = false;
|
||||
StepDescription = stepDescription;
|
||||
Score = score;
|
||||
RequireCorrectCompletion = true; // 默认为需要正确完成
|
||||
RequireCorrectCompletion = true;
|
||||
TargetObjectEvents = new Dictionary<string, Action>();
|
||||
|
||||
TargetObjectEvents= new Dictionary<string, Action>();
|
||||
// 初始化新增字段
|
||||
ActionType = ProcessActionType.默认;
|
||||
JudgmentQuestions = new List<JudgmentQuestionConfig>();
|
||||
MultipleChoiceQuestions = new List<MultipleChoiceConfig>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
"StepDescription": "任务要求",
|
||||
"Actions": [
|
||||
{
|
||||
"ActionType": 0,
|
||||
"JudgmentQuestions": null,
|
||||
"Title": "进入仿真系统,弹框显示任务要求",
|
||||
"TargetObjects": [
|
||||
{
|
||||
|
@ -32,6 +34,32 @@
|
|||
"StepDescription": "收货前准备",
|
||||
"Actions": [
|
||||
{
|
||||
"ActionType": 1,
|
||||
"JudgmentQuestions": [
|
||||
{
|
||||
"Question": "自行选择行进路线",
|
||||
"CorrectAnswer": "步行至安全帽存放区"
|
||||
}
|
||||
],
|
||||
"Title": "选择行进路线",
|
||||
"TargetObjects": [],
|
||||
"Action": null,
|
||||
"Description": "选择行进路线",
|
||||
"IsSequential": false,
|
||||
"ClickedObjects": [],
|
||||
"CurrentObjectIndex": 0,
|
||||
"FeedbackDisplayed": false,
|
||||
"StepDescription": "",
|
||||
"Score": 0.0,
|
||||
"SceneName": null,
|
||||
"RequiresSceneSwitch": false,
|
||||
"TargetObjectEvents": {},
|
||||
"ProcessStepIndex": 0,
|
||||
"RequireCorrectCompletion": true
|
||||
},
|
||||
{
|
||||
"ActionType": 0,
|
||||
"JudgmentQuestions": null,
|
||||
"Title": "领取并佩戴安全帽",
|
||||
"TargetObjects": [
|
||||
{
|
||||
|
@ -61,6 +89,8 @@
|
|||
"StepDescription": "卸货",
|
||||
"Actions": [
|
||||
{
|
||||
"ActionType": 0,
|
||||
"JudgmentQuestions": null,
|
||||
"Title": "单据验收",
|
||||
"TargetObjects": [
|
||||
{
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
[
|
||||
{
|
||||
"StepDescription": "新步骤",
|
||||
"Actions": [
|
||||
{
|
||||
"ActionType": 0,
|
||||
"JudgmentQuestions": null,
|
||||
"MultipleChoiceQuestions": null,
|
||||
"Title": "新动作",
|
||||
"TargetObjects": [
|
||||
{
|
||||
"Item1": "对象1",
|
||||
"Item2": 0
|
||||
},
|
||||
{
|
||||
"Item1": "对象2",
|
||||
"Item2": 1
|
||||
}
|
||||
],
|
||||
"Action": null,
|
||||
"Description": "",
|
||||
"IsSequential": false,
|
||||
"ClickedObjects": [],
|
||||
"CurrentObjectIndex": 0,
|
||||
"FeedbackDisplayed": false,
|
||||
"StepDescription": "",
|
||||
"Score": 11.0,
|
||||
"SceneName": null,
|
||||
"RequiresSceneSwitch": false,
|
||||
"TargetObjectEvents": {},
|
||||
"ProcessStepIndex": 0,
|
||||
"RequireCorrectCompletion": true
|
||||
},
|
||||
{
|
||||
"ActionType": 1,
|
||||
"JudgmentQuestions": [
|
||||
{
|
||||
"Question": "我是判断题",
|
||||
"CorrectAnswer": "正确"
|
||||
}
|
||||
],
|
||||
"MultipleChoiceQuestions": null,
|
||||
"Title": "新动作",
|
||||
"TargetObjects": [],
|
||||
"Action": null,
|
||||
"Description": "",
|
||||
"IsSequential": false,
|
||||
"ClickedObjects": [],
|
||||
"CurrentObjectIndex": 0,
|
||||
"FeedbackDisplayed": false,
|
||||
"StepDescription": "",
|
||||
"Score": 22.0,
|
||||
"SceneName": null,
|
||||
"RequiresSceneSwitch": false,
|
||||
"TargetObjectEvents": {},
|
||||
"ProcessStepIndex": 0,
|
||||
"RequireCorrectCompletion": true
|
||||
},
|
||||
{
|
||||
"ActionType": 2,
|
||||
"JudgmentQuestions": null,
|
||||
"MultipleChoiceQuestions": [
|
||||
{
|
||||
"Question": "我是多选题",
|
||||
"Options": [
|
||||
"1",
|
||||
"2",
|
||||
"3"
|
||||
],
|
||||
"CorrectAnswers": []
|
||||
}
|
||||
],
|
||||
"Title": "新动作",
|
||||
"TargetObjects": [],
|
||||
"Action": null,
|
||||
"Description": "",
|
||||
"IsSequential": false,
|
||||
"ClickedObjects": [],
|
||||
"CurrentObjectIndex": 0,
|
||||
"FeedbackDisplayed": false,
|
||||
"StepDescription": "",
|
||||
"Score": 33.0,
|
||||
"SceneName": null,
|
||||
"RequiresSceneSwitch": false,
|
||||
"TargetObjectEvents": {},
|
||||
"ProcessStepIndex": 0,
|
||||
"RequireCorrectCompletion": true
|
||||
}
|
||||
],
|
||||
"IsCompleted": false,
|
||||
"StepNumber": 0
|
||||
}
|
||||
]
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f234aaa8022727a4d9aebb37fbec132d
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -26,12 +26,13 @@ public class test : MonoBehaviour
|
|||
public void HHHH()
|
||||
{
|
||||
// MotionEngine.GetModule<ProcessManager>().JumpToProcessAsync(4,1);
|
||||
MotionEngine.GetModule<ProcessManager>().HandleClick("1");
|
||||
MotionEngine.GetModule<ProcessManager>().HandleClick("2");
|
||||
MotionEngine.GetModule<ProcessManager>().HandleClick("3");
|
||||
MotionEngine.GetModule<ProcessManager>().HandleClick("²ÝÄàÂí");
|
||||
MotionEngine.GetModule<ProcessManager>().HandleClick("对象1");
|
||||
MotionEngine.GetModule<ProcessManager>().HandleClick("对象2");
|
||||
MotionEngine.GetModule<ProcessManager>().HandleClick("正确");
|
||||
MotionEngine.GetModule<ProcessManager>().HandleClick(new List<string>(){"1","2","3","4"});
|
||||
// MotionEngine.GetModule<ProcessManager>().HandleClick(new List<string>(){"3"});
|
||||
// MotionEngine.GetModule<ProcessManager>().HandleClick("2");
|
||||
MotionEngine.GetModule<ProcessManager>().CalculateTotalScore();
|
||||
MotionEngine.GetModule<ProcessManager>().CalculateTotalScore();
|
||||
// MotionEngine.GetModule<ProcessManager>().HandleClick("1");
|
||||
// MotionEngine.GetModule<ProcessManager>().HandleClick("2");
|
||||
// MotionEngine.GetModule<ProcessManager>().HandleClick("3");
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Framework.ProcessMode;
|
||||
using Framework.Dto;
|
||||
|
||||
/// <summary>
|
||||
/// 测试 流程事件处理类
|
||||
/// </summary>
|
||||
public class 测试ProcessEvents : MonoBehaviour
|
||||
{
|
||||
[ProcessAction]
|
||||
public void RegisterProcessEvents()
|
||||
{
|
||||
/// <summary>
|
||||
/// 步骤 1: 新步骤
|
||||
/// 动作 1: 新动作
|
||||
/// 目标对象: 对象1
|
||||
/// </summary>
|
||||
EventRegistrationCenter.AddEventsToAllStepEvents(new EventStepInfo(0, 0, "对象1", () =>
|
||||
{
|
||||
// 在这里加入事件处理逻辑
|
||||
Debug.Log("执行事件:步骤 1 -> 动作 1 -> 对象1");
|
||||
}));
|
||||
|
||||
/// <summary>
|
||||
/// 步骤 1: 新步骤
|
||||
/// 动作 1: 新动作
|
||||
/// 目标对象: 对象2
|
||||
/// </summary>
|
||||
EventRegistrationCenter.AddEventsToAllStepEvents(new EventStepInfo(0, 0, "对象2", () =>
|
||||
{
|
||||
// 在这里加入事件处理逻辑
|
||||
Debug.Log("执行事件:步骤 1 -> 动作 1 -> 对象2");
|
||||
}));
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3bd3db593220f784fac95b607eb2c8b3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue