32 lines
975 B
C#
32 lines
975 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace DefaultNamespace.ProcessMode
|
|
{
|
|
/// <summary>
|
|
/// 表示一个流程步骤的类
|
|
/// </summary>
|
|
public class AnimationStep
|
|
{
|
|
public string StepDescription { get; set; } // 步骤描述
|
|
public float Score { get; set; } // 步骤评分
|
|
public List<ActionWithDescription> Actions { get; private set; } // 动作列表
|
|
|
|
public AnimationStep(string stepDescription, float score, List<ActionWithDescription> actions)
|
|
{
|
|
StepDescription = stepDescription;
|
|
Score = score;
|
|
Actions = actions;
|
|
}
|
|
|
|
public void PlayAnimation(int index)
|
|
{
|
|
if (index >= 0 && index < Actions.Count)
|
|
{
|
|
Actions[index].Action?.Invoke(); // 执行动画
|
|
// Debug.Log(Actions[index].Description); // 输出动作描述
|
|
}
|
|
}
|
|
}
|
|
} |