using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Rendering.VirtualTexturing;
///
/// 步骤状态控制(配置步骤初始状态,断线重连步骤状态加载,步骤状态结果实时提交)
///
public class StepStateControl : MonoBehaviour
{
//场景初始化
//背包初始化
//提示初始化
//设备初始化
//工具和材料初始化
//自定义初始化
public static StepStateControl instance;
List m_Steps;
private void Awake()
{
DontDestroyOnLoad(gameObject);
instance = this;
m_Steps = transform.GetComponentsInChildren(true).ToList();
m_Steps.ForEach(a=> { a.Init(); });
}
///
/// 设置现场控制脚本
///
///
///
public void SetDeviceControl(int subejctid,Device_Control control)
{
m_Steps.Find(a=>a.schemeId== subejctid).SetDeviceControl(control);
}
///
/// 调用初始化步骤
///
///
///
///
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);
}
}
}