78 lines
2.9 KiB
C#
78 lines
2.9 KiB
C#
// using System;
|
|
// using System.Collections;
|
|
// using System.Collections.Generic;
|
|
// using System.Threading.Tasks;
|
|
// using DefaultNamespace;
|
|
// using DefaultNamespace.Dto;
|
|
// using DefaultNamespace.ProcessMode;
|
|
// using MotionFramework;
|
|
// using Newtonsoft.Json;
|
|
// using UnityEngine;
|
|
//
|
|
// namespace ToolsPack
|
|
// {
|
|
//
|
|
//
|
|
// [ScriptDescription("工具间场景的流程启动器")]
|
|
// public class ToolsSceneProcessLauncher : MonoBehaviour
|
|
// {
|
|
// private AnimationProcessManager processManager;
|
|
//
|
|
//
|
|
// private async void Start()
|
|
// {
|
|
// await Task.Delay(TimeSpan.FromSeconds(1));
|
|
//
|
|
//
|
|
// processManager = MotionEngine.GetModule<AnimationProcessManager>();
|
|
//
|
|
//
|
|
// processManager.ClearProcess();
|
|
//
|
|
//
|
|
// processManager.AddProcess( MotionEngine.GetModule<DataConfigManager>().GetProcessMode().ToString());
|
|
//
|
|
// string json =
|
|
// StepsContainer stepsContainer = JsonConvert.DeserializeObject<StepsContainer>(json);
|
|
//
|
|
//
|
|
// foreach (var stepData in stepsContainer.Steps)
|
|
// {
|
|
// List<ActionWithDescription> actions = new List<ActionWithDescription>();
|
|
//
|
|
// foreach (var actionData in stepData.Actions)
|
|
// {
|
|
// List<string> targetObjects = new List<string>();
|
|
// foreach (var objectName in actionData.TargetObjects)
|
|
// {
|
|
// targetObjects.Add(objectName);
|
|
// }
|
|
//
|
|
// Action action = () => { };
|
|
// actions.Add(new ActionWithDescription(targetObjects, action, actionData.Description, actionData.IsSequential,stepData.StepDescription));
|
|
// }
|
|
//
|
|
// AnimationStep step = new AnimationStep(stepData.StepDescription, stepData.Score, actions);
|
|
// processManager.AddStepToProcess(MotionEngine.GetModule<DataConfigManager>().GetProcessMode().ToString(), step);
|
|
// }
|
|
//
|
|
// InitializeFirstStep();
|
|
//
|
|
// }
|
|
//
|
|
// private void InitializeFirstStep()
|
|
// {
|
|
// 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>().HandleModeFeedback(MotionEngine.GetModule<DataConfigManager>().GetProcessMode(), firstStep.Actions[0]);
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// }
|
|
// } |