Timeline UI
This commit is contained in:
1 parent
c8626a9806
commit
2697212f05
177 files changed
+52513
-41627
No files matched your search
@@ -1,6 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using Code.OfficeGame.BattleMode.Timeline;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using R3;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -10,9 +12,27 @@ namespace Code.OfficeGame.BattleMode.Actions
|
||||
{
|
||||
public BattleAction CurrentAction { get; protected set;}
|
||||
public bool Finished => CurrentAction == null || CurrentAction.Finished;
|
||||
|
||||
private readonly Subject<TimelineBattleAction> _onActionSet = new();
|
||||
public Observable<TimelineBattleAction> OnActionSet => _onActionSet;
|
||||
|
||||
protected void SetCurrentAction(BattleAction action, int durationInFrames)
|
||||
{
|
||||
CurrentAction = action;
|
||||
|
||||
_onActionSet.OnNext(new TimelineBattleAction
|
||||
{
|
||||
EntityId = gameObject.GetEntityId(),
|
||||
Frame = durationInFrames
|
||||
});
|
||||
}
|
||||
private void OnDestroy()
|
||||
{
|
||||
_onActionSet.Dispose();
|
||||
}
|
||||
|
||||
public abstract UniTask DecideAction(CancellationToken ctx);
|
||||
public abstract void ForceDecideAction(BattleActionType actionType);
|
||||
public abstract UniTaskVoid ForceDecideAction(BattleActionType actionType);
|
||||
|
||||
[DoNotSerialize] public Animator animator;
|
||||
|
||||
|
||||
Reference in new issue
Block a user