46 lines
995 B
C#
46 lines
995 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using TMPro;
|
|
|
|
public class StepManager : SingletonMono<StepManager>
|
|
{
|
|
public Color unfinishColor = Color.black;
|
|
public Color finishColor = Color.green;
|
|
public Transform stepNode;
|
|
|
|
protected List<string> stepNameList = new List<string>();
|
|
|
|
//void Awake()
|
|
//{
|
|
// stepNameList.Clear();
|
|
|
|
//}
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void FinishStep(string triggerName)
|
|
{
|
|
if (triggerName.Trim() == "" || triggerName == null) return;
|
|
for (int i = 0; i < stepNode.childCount; i++)
|
|
{
|
|
TMP_Text tMP_Text = stepNode.GetChild(i).GetComponent<TMP_Text>();
|
|
if (tMP_Text.text.EndsWith(triggerName))
|
|
{
|
|
tMP_Text.color = finishColor;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|