Tz2/Assets/Zion/Scripts/FlowSubStep.cs

75 lines
1.5 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
///
/// </summary>
public class FlowSubStep : 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 FlowSubStep nextStep;
/// <summary>
/// 步骤初始化
/// </summary>
public StepInit stepInit;
/// <summary>
/// 步骤被激活时调用的方法
/// </summary>
private void OnStepActivated()
{
Debug.Log($"<color=red>动作 {_stepNum} 已被激活: {currentStep}</color>");
// 在这里添加你想要执行的逻辑
if (stepInit != null)
{
stepInit.Init();
}
}
}