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