E_ElecCompetition/Electrical_inspectionCompet.../Assets/Script/Flow/FlowControlManager.cs

84 lines
1.7 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FlowControlManager : MonoBehaviour
{
public int index;
public List<FlowControlBase> = new List<FlowControlBase>();
public bool ;
private int oldindex;
private int checkindex;
public int = 0;
// Start is called before the first frame update
void Start()
{
foreach (var item in GetComponentsInChildren<FlowControlBase>())
{
.Add(item);
}
for (int i = 0; i < .Count; i++)
{
[i].reset();
}
if ( == true)
{
for (int i = 0; i < .Count; i++)
{
[i].ON = true;
}
}
}
// Update is called once per frame
void Update()
{
nodechange();
if ([index]. == .)
{
[index].Update();
}
NextNode();
}
/// <summary>
/// 切换步骤
/// </summary>
public void nodechange() {
if ([index].first == true)
{
[index].reset();
[index].Enter();
// Debug.Log("触发1");
[index].first = false;
}
}
public void NextNode() {
if ([index]. == .)
{
+= [index].;
[index].reset();
index = index+=1;
}
}
/// <summary>
/// 侦测步骤变化
/// </summary>
}