This commit is contained in:
parent
500317e3b7
commit
052971a5f8
|
@ -52,9 +52,6 @@ public class GameLauncher : MonoBehaviour
|
|||
|
||||
private void CreateGameModules()
|
||||
{
|
||||
// 创建事件管理器
|
||||
MotionEngine.CreateModule<EventManager>();
|
||||
|
||||
//webrequest管理器
|
||||
MotionEngine.CreateModule<WebRequestManager>();
|
||||
|
||||
|
@ -67,6 +64,9 @@ public class GameLauncher : MonoBehaviour
|
|||
//流程管理器
|
||||
MotionEngine.CreateModule<AnimationProcessManager>();
|
||||
|
||||
//加载配置信息
|
||||
MotionEngine.CreateModule<InfoDataManager>();
|
||||
|
||||
}
|
||||
|
||||
private void HandleMotionFrameworkLog(ELogLevel logLevel, string log)
|
||||
|
|
|
@ -1627,6 +1627,7 @@ GameObject:
|
|||
- component: {fileID: 8410584963409699975}
|
||||
- component: {fileID: 328384968636471287}
|
||||
- component: {fileID: 3034258414160536299}
|
||||
- component: {fileID: 5355724877285991378}
|
||||
m_Layer: 5
|
||||
m_Name: "\u6D41\u7A0B\u7ED3\u675F"
|
||||
m_TagString: Untagged
|
||||
|
@ -1696,6 +1697,19 @@ MonoBehaviour:
|
|||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &5355724877285991378
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3749027150314622874}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: c663c5e4a9134a54b80d0e2a913c31e2, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
confirmBt: {fileID: 7246041337635750621}
|
||||
--- !u!1 &3769303647029597975
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -13824,7 +13824,7 @@ GameObject:
|
|||
m_Component:
|
||||
- component: {fileID: 654503842}
|
||||
m_Layer: 0
|
||||
m_Name: "\u4E34\u65F6\u7528\u7535 (1)"
|
||||
m_Name: "\u73B0\u573A\u8C03\u8BD5"
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
@ -25488,37 +25488,6 @@ CanvasRenderer:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1231888216}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1235900275
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1235900276}
|
||||
m_Layer: 0
|
||||
m_Name: "\u4E34\u65F6\u7528\u7535 (2)"
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1235900276
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1235900275}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 103.43629, y: -2.6000328, z: -527.04504}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1238574002
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -237829,4 +237798,3 @@ SceneRoots:
|
|||
- {fileID: 1199227227}
|
||||
- {fileID: 912118588}
|
||||
- {fileID: 654503842}
|
||||
- {fileID: 1235900276}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DefaultNamespace.ProcessMode;
|
||||
using MotionFramework;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ConsumePowerManager : MonoBehaviour
|
||||
{
|
||||
public Button confirmBt;
|
||||
void Start()
|
||||
{
|
||||
confirmBt.onClick.AddListener(delegate
|
||||
{
|
||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(GameObject.Find("临时用电"));
|
||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(GameObject.Find("现场调试"));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c663c5e4a9134a54b80d0e2a913c31e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -15,10 +15,14 @@ namespace DefaultNamespace
|
|||
private Dictionary<string, List<string>> toolsPackDict;
|
||||
private List<string> teachingData;
|
||||
|
||||
|
||||
[SerializeField] private ProcessMode.ProcessMode _processMode;
|
||||
|
||||
|
||||
public void OnCreate(object createParam)
|
||||
{
|
||||
LoadConfig();
|
||||
|
||||
|
||||
// LoadTeachingData();
|
||||
}
|
||||
|
||||
|
@ -34,6 +38,35 @@ namespace DefaultNamespace
|
|||
{
|
||||
}
|
||||
|
||||
public void SetProcessMode(int index)
|
||||
{
|
||||
if (index == 0)
|
||||
{
|
||||
_processMode = DefaultNamespace.ProcessMode.ProcessMode.Teaching;
|
||||
}
|
||||
else if (index == 1)
|
||||
{
|
||||
_processMode = DefaultNamespace.ProcessMode.ProcessMode.Training;
|
||||
}
|
||||
else if (index == 2)
|
||||
{
|
||||
_processMode = DefaultNamespace.ProcessMode.ProcessMode.Practice;
|
||||
}
|
||||
else if (index == 3)
|
||||
{
|
||||
_processMode = DefaultNamespace.ProcessMode.ProcessMode.Assessment;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Debug.Log("当前流程模式---->"+_processMode);
|
||||
}
|
||||
|
||||
public ProcessMode.ProcessMode GetProcessMode()
|
||||
{
|
||||
return _processMode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取教学工具包设备高亮数据
|
||||
/// </summary>
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using DefaultNamespace;
|
||||
using MotionFramework;
|
||||
using UnityEngine;
|
||||
|
||||
public class InfoDataManager : ModuleSingleton<InfoDataManager>, IModule
|
||||
{
|
||||
private void ParseFileContent(string content)
|
||||
{
|
||||
// 首先按照 # 进行分割,获取日期和数据部分
|
||||
var parts = content.Split('#');
|
||||
if (parts.Length < 2)
|
||||
{
|
||||
Debug.LogError("Invalid file format.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 日期部分
|
||||
string date = parts[0];
|
||||
Debug.Log("Date: " + date);
|
||||
|
||||
// 数据部分
|
||||
string dataPart = parts[1];
|
||||
// 进一步分割数据部分
|
||||
var dataSections = dataPart.Split(';');
|
||||
|
||||
if (dataSections.Length < 2)
|
||||
{
|
||||
Debug.LogError("Invalid data format.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 第一部分 sxfz://
|
||||
string prefix = dataSections[0];
|
||||
Debug.Log("Prefix: " + prefix);
|
||||
|
||||
// 第二部分 lyht,0,18,userId,username,token,90
|
||||
string dataSection = dataSections[1];
|
||||
var dataElements = dataSection.Split(',');
|
||||
|
||||
if (dataElements.Length < 7)
|
||||
{
|
||||
Debug.LogError("Invalid data section format.");
|
||||
return;
|
||||
}
|
||||
|
||||
string code = dataElements[0];
|
||||
string value1 = dataElements[1];
|
||||
string value2 = dataElements[2];
|
||||
string userId = dataElements[3];
|
||||
string username = dataElements[4];
|
||||
string token = dataElements[5];
|
||||
string value3 = dataElements[6];
|
||||
|
||||
Debug.Log("Code: " + code);
|
||||
Debug.Log("Value 1: " + value1);
|
||||
Debug.Log("Value 2: " + value2);
|
||||
Debug.Log("User ID: " + userId);
|
||||
Debug.Log("Username: " + username);
|
||||
Debug.Log("Token: " + token);
|
||||
Debug.Log("Value 3: " + value3);
|
||||
|
||||
|
||||
|
||||
MotionEngine.GetModule<DataConfigManager>().SetProcessMode(int.Parse(value1));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void OnCreate(object createParam)
|
||||
{
|
||||
string content = System.IO.File.ReadAllText(Application.streamingAssetsPath + "/info.ini");
|
||||
ParseFileContent(content);
|
||||
}
|
||||
|
||||
public void OnUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public void OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 914ec2cdc53f2a1478e39f34127e766d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -33,11 +33,14 @@ namespace DefaultNamespace.ProcessMode
|
|||
|
||||
public void AddProcess(string type)
|
||||
{
|
||||
if (!processes.ContainsKey(type))
|
||||
{
|
||||
processes[type] = new AnimationProcess(type);
|
||||
Enum.TryParse(type, true, out currentMode);
|
||||
}
|
||||
// if (!processes.ContainsKey(type))
|
||||
// {
|
||||
// processes[type] = new AnimationProcess(type);
|
||||
// Enum.TryParse(type, true, out currentMode);
|
||||
// }
|
||||
|
||||
processes[type] = new AnimationProcess(type);
|
||||
Enum.TryParse(type, true, out currentMode);
|
||||
}
|
||||
|
||||
public void ClearProcess()
|
||||
|
|
|
@ -20,15 +20,13 @@ namespace DefaultNamespace.ProcessMode
|
|||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||
|
||||
|
||||
|
||||
|
||||
processManager = MotionEngine.GetModule<AnimationProcessManager>();
|
||||
|
||||
|
||||
processManager.ClearProcess();
|
||||
|
||||
processManager.AddProcess("Training");
|
||||
processManager.AddProcess(MotionEngine.GetModule<DataConfigManager>().GetProcessMode().ToString());
|
||||
|
||||
string json = System.IO.File.ReadAllText(Application.streamingAssetsPath + "/DataConfig/SceneStepData.json");
|
||||
StepsContainer stepsContainer = JsonConvert.DeserializeObject<StepsContainer>(json);
|
||||
|
@ -58,7 +56,7 @@ namespace DefaultNamespace.ProcessMode
|
|||
}
|
||||
|
||||
AnimationStep step = new AnimationStep(stepData.StepDescription, stepData.Score, actions);
|
||||
processManager.AddStepToProcess("Training", step);
|
||||
processManager.AddStepToProcess(MotionEngine.GetModule<DataConfigManager>().GetProcessMode().ToString(), step);
|
||||
}
|
||||
|
||||
InitializeFirstStep();
|
||||
|
|
|
@ -61,21 +61,21 @@ namespace ToolsPack
|
|||
|
||||
// 解析JSON字符串
|
||||
SceneData sceneData = JsonConvert.DeserializeObject<SceneData>(json);
|
||||
|
||||
// 输出一些数据来验证解析
|
||||
Debug.Log("场景名称: " + sceneData.scenename);
|
||||
Debug.Log("任务描述: " + sceneData.questbooks);
|
||||
Debug.Log("用户信息: " + sceneData.userinformation);
|
||||
Debug.Log("电能表信息: " + sceneData.energyinformation);
|
||||
|
||||
foreach (var energy in sceneData.energylist)
|
||||
{
|
||||
Debug.Log("Work: " + energy.work);
|
||||
foreach (var worklist in energy.worklist)
|
||||
{
|
||||
Debug.Log($"Key: {worklist.keywork}, Value: {worklist.valuework}");
|
||||
}
|
||||
}
|
||||
//
|
||||
// // 输出一些数据来验证解析
|
||||
// Debug.Log("场景名称: " + sceneData.scenename);
|
||||
// Debug.Log("任务描述: " + sceneData.questbooks);
|
||||
// Debug.Log("用户信息: " + sceneData.userinformation);
|
||||
// Debug.Log("电能表信息: " + sceneData.energyinformation);
|
||||
//
|
||||
// foreach (var energy in sceneData.energylist)
|
||||
// {
|
||||
// Debug.Log("Work: " + energy.work);
|
||||
// foreach (var worklist in energy.worklist)
|
||||
// {
|
||||
// Debug.Log($"Key: {worklist.keywork}, Value: {worklist.valuework}");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using DefaultNamespace;
|
||||
using DefaultNamespace.Dto;
|
||||
using DefaultNamespace.ProcessMode;
|
||||
using MotionFramework;
|
||||
|
@ -29,7 +30,7 @@ namespace ToolsPack
|
|||
processManager.ClearProcess();
|
||||
|
||||
|
||||
processManager.AddProcess("Training");
|
||||
processManager.AddProcess( MotionEngine.GetModule<DataConfigManager>().GetProcessMode().ToString());
|
||||
|
||||
string json = System.IO.File.ReadAllText(Application.streamingAssetsPath + "/DataConfig/ToolsSceneStepData.json");
|
||||
StepsContainer stepsContainer = JsonConvert.DeserializeObject<StepsContainer>(json);
|
||||
|
@ -60,7 +61,7 @@ namespace ToolsPack
|
|||
}
|
||||
|
||||
AnimationStep step = new AnimationStep(stepData.StepDescription, stepData.Score, actions);
|
||||
processManager.AddStepToProcess("Training", step);
|
||||
processManager.AddStepToProcess(MotionEngine.GetModule<DataConfigManager>().GetProcessMode().ToString(), step);
|
||||
}
|
||||
|
||||
InitializeFirstStep();
|
||||
|
@ -69,15 +70,14 @@ namespace ToolsPack
|
|||
|
||||
private void InitializeFirstStep()
|
||||
{
|
||||
ProcessMode initialMode = ProcessMode.Training; // 假设初始模式是教学模式
|
||||
MotionEngine.GetModule<AnimationProcessManager>().SetCurrentMode(initialMode);
|
||||
MotionEngine.GetModule<AnimationProcessManager>().SetCurrentMode(MotionEngine.GetModule<DataConfigManager>().GetProcessMode());
|
||||
|
||||
if (MotionEngine.GetModule<AnimationProcessManager>().CurrentProcess.Steps.Count > 0)
|
||||
{
|
||||
AnimationStep firstStep = MotionEngine.GetModule<AnimationProcessManager>().CurrentProcess.Steps[0];
|
||||
if (firstStep.Actions.Count > 0)
|
||||
{
|
||||
MotionEngine.GetModule<AnimationProcessManager>().PrepareNextStep(initialMode, firstStep.Actions[0]);
|
||||
MotionEngine.GetModule<AnimationProcessManager>().PrepareNextStep(MotionEngine.GetModule<DataConfigManager>().GetProcessMode(), firstStep.Actions[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -264,6 +264,7 @@
|
|||
"盖_透明外壳"
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"description": "点击柜门卡栓还原关门",
|
||||
"score": 0,
|
||||
|
|
|
@ -1 +1 @@
|
|||
2024-06-14 15:04:12#'sxfz://;lyht,0,18,userId,username,token,90;/'|
|
||||
2024-06-14 15:04:12#'sxfz://;lyht,1,18,userId,username,token,90;/'|
|
|
@ -59,8 +59,7 @@ public class DisplayKnapsackObjects : MonoBehaviour
|
|||
});
|
||||
processBt.onClick.AddListener(delegate
|
||||
{
|
||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(processBt.gameObject);
|
||||
MotionEngine.GetModule<AnimationProcessManager>().HandleClick(processBt.gameObject);
|
||||
|
||||
ui.SetActive(false);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ PlayerSettings:
|
|||
targetDevice: 2
|
||||
useOnDemandResources: 0
|
||||
accelerometerFrequency: 60
|
||||
companyName: DefaultCompany
|
||||
productName: SXElectricityInformationAcquisition
|
||||
companyName: App
|
||||
productName: App
|
||||
defaultCursor: {fileID: 0}
|
||||
cursorHotspot: {x: 0, y: 0}
|
||||
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
|
||||
|
|
Loading…
Reference in New Issue