30 lines
900 B
C#
30 lines
900 B
C#
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using Cysharp.Threading.Tasks;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
|
|
namespace Code.OfficeGame.BattleMode.Actions
|
|
{
|
|
public abstract class EntityTimelineActor : MonoBehaviour
|
|
{
|
|
public BattleAction CurrentAction { get; protected set;}
|
|
public bool Finished => CurrentAction == null || CurrentAction.Finished;
|
|
|
|
public abstract UniTask DecideAction(CancellationToken ctx);
|
|
|
|
[DoNotSerialize] public Animator animator;
|
|
|
|
protected readonly Dictionary<BattleActionType, BattleAction> BattleActions = new();
|
|
|
|
private void Awake()
|
|
{
|
|
animator = GetComponentInChildren<Animator>();
|
|
|
|
foreach (var action in GetComponents<BattleAction>())
|
|
{
|
|
BattleActions.Add(action.ActionType, action);
|
|
}
|
|
}
|
|
}
|
|
} |