using System.Collections;
using System.Collections.Generic;
using UnityEngine;
///
/// 流程步骤
///
public class FlowStep : MonoBehaviour
{
///
/// 当前步骤
///
private int _stepNum = 1;
public int stepNum
{
get { return _stepNum; }
set { _stepNum = value; }
}
///
/// 当前步骤内容
///
private string _currentStep = "";
public string currentStep
{
get { return _currentStep; }
set { _currentStep = value; }
}
///
/// 步骤是否启动
///
private bool _isActivate = false;
public bool isActivate
{
get { return _isActivate; }
set
{
_isActivate = value;
if (_isActivate)
{
OnStepActivated();
}
}
}
///
/// 步骤是否完成
///
public bool isCompleted = false;
///
/// 下一步
///
public FlowStep nextStep;
///
/// 步骤初始化
///
public StepInit stepInit;
///
/// 子步骤
///
public List flowSubSteps = new List();
///
/// 步骤被激活时调用的方法
///
private void OnStepActivated()
{
Debug.Log($"步骤 {_stepNum} 已被激活: {currentStep}");
// 在这里添加你想要执行的逻辑
if(stepInit!= null)
{
stepInit.Init();
}
}
}