using System.Collections; using System.Collections.Generic; using UnityEngine; public class FlowControlManager : MonoBehaviour { public int index; public List 步骤合集 = new List(); 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()) { 步骤合集.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(); } /// /// 切换步骤 /// 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; } } /// /// 侦测步骤变化 /// }