57 lines
1.5 KiB
C#
57 lines
1.5 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering.VirtualTexturing;
|
|
|
|
/// <summary>
|
|
/// 步骤状态控制(配置步骤初始状态,断线重连步骤状态加载,步骤状态结果实时提交)
|
|
/// </summary>
|
|
public class StepStateControl : MonoBehaviour
|
|
{
|
|
//场景初始化
|
|
//背包初始化
|
|
//提示初始化
|
|
//设备初始化
|
|
//工具和材料初始化
|
|
//自定义初始化
|
|
|
|
public static StepStateControl instance;
|
|
List<StepState> m_Steps;
|
|
|
|
private void Awake()
|
|
{
|
|
DontDestroyOnLoad(gameObject);
|
|
instance = this;
|
|
m_Steps = transform.GetComponentsInChildren<StepState>(true).ToList();
|
|
m_Steps.ForEach(a=> { a.Init(); });
|
|
}
|
|
|
|
/// <summary>
|
|
/// 设置现场控制脚本
|
|
/// </summary>
|
|
/// <param name="subejctid"></param>
|
|
/// <param name="control"></param>
|
|
public void SetDeviceControl(int subejctid,Device_Control control)
|
|
{
|
|
m_Steps.Find(a=>a.schemeId== subejctid).SetDeviceControl(control);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 调用初始化步骤
|
|
/// </summary>
|
|
/// <param name="process"></param>
|
|
/// <param name="subProcess"></param>
|
|
/// <param name="step"></param>
|
|
public void InvokeInitStepState(int systemId, int schemeId, int subProcessId)
|
|
{
|
|
StepState tmp=m_Steps.Find(a => a.systemId == systemId && a.schemeId == schemeId);
|
|
if (tmp != null)
|
|
{
|
|
Debug.Log("执行步骤状态设置跳步骤");
|
|
tmp.JumpStep(subProcessId);
|
|
}
|
|
}
|
|
}
|