ShanxiKnowledgeBase/SXElectricalInspection/Assets/Script/Flow/FlowControlBase.cs

143 lines
3.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HighlightingSystem;
public class FlowControlBase : MonoBehaviour
{
public = .;
/// <summary>
/// 该步骤高亮提示脚本合集
/// </summary>
public GameObject[] ;
/// <summary>
/// 该步骤中需要完成交互的物体
/// </summary>
public FlowInterObjectBase[] ;
/// <summary>
/// 交互物体的总控父物体
/// </summary>
public GameObject father;
//private List<FlowInterObjectBase> 已完成交互;
/// <summary>
/// 该步骤的分值
/// </summary>
public int =0;
/// <summary>
/// 已完成步骤数
/// </summary>
public int = 0;
/// <summary>
/// 只进行一次的阶段控制开关
/// </summary>
[HideInInspector]
public bool first = true;
public bool ON = false;
// Start is called before the first frame update
// Update is called once per frame
public virtual void reset()
{
= .;
father.SetActive(false);
for (int i = 0; i < .Length; i++)
{if ([i].GetComponent<HighlightingSystem.Highlighter>())
{
[i].GetComponent<HighlightingSystem.Highlighter>().constant = false;
// Debug.Log("触发");
if ([i].name == "高亮")
{
[i].SetActive(false);
}
}
else
{
[i].SetActive(false);
//Debug.Log("触发");
}
}
for (int i = 0; i < .Length; i++)
{
[i]. = false;
[i].first = true;
}
}
public virtual void Enter()
{
father.SetActive(true) ;
if (ON == true)
{
for (int i = 0; i < .Length; i++)
{
if ([i].GetComponent<HighlightingSystem.Highlighter>())
{
[i].GetComponent<HighlightingSystem.Highlighter>().constant = true;
// Debug.Log("触发");
if ([i].name == "高亮")
{
[i].SetActive(true);
}
}
else
{
[i].SetActive(true);
//Debug.Log("触发");
}
}
}
= .;
}
public virtual void Update()
{
if ( == .)
{
for (int i = 0; i < .Length; i++)
{
if ([i]. == true && [i].first == true)
{
+= [i].;
+=1;
[i].first = false;
}
}
if ( == .Length)
{ Complete(); }
}
}
public virtual void Complete()
{
= .;
}
}