fix pose action

This commit is contained in:
NguyenVanDat
2025-12-17 17:16:55 +07:00
parent 220d1792a3
commit 1bc54fa74a
6 changed files with 73 additions and 60 deletions
+5 -4
View File
@@ -20,7 +20,7 @@ namespace BrewMonster
[SerializeField] private int id;
private const float FadeTime = 0.1f;
private const FadeMode FadeMode = Animancer.FadeMode.FixedDuration;
private const FadeMode FadeMode = Animancer.FadeMode.NormalizedDuration;
QueueActionEvent queueActionEvent;
private void PlayActionEventHandler(PlayActionEvent @event)
@@ -31,7 +31,7 @@ namespace BrewMonster
_animationList = _animationQueue.ToList();
return;
}
InternalPlayAnimation(@event.AnimationName);
InternalPlayAnimation(@event.AnimationName, @event.ITransTime);
}
public void InitPlayerEventDoneHandler()
{
@@ -130,7 +130,8 @@ namespace BrewMonster
}
string animName = _animationQueue.Dequeue();
_animationList = _animationQueue.ToList();
InternalPlayAnimation(animName);
//TODO: default fadetime = 200 remake later
InternalPlayAnimation(animName,200);
}
void ApplyDamage()
{
@@ -160,7 +161,7 @@ namespace BrewMonster
/// <param name="fadeMode"></param>
private void InternalPlayAnimation(string animationName, float duration = FadeTime, FadeMode fadeMode = FadeMode)
{
_currentState = namedAnimancer.TryPlay(animationName, duration, fadeMode);
_currentState = namedAnimancer.TryPlay(animationName, duration / 1000, fadeMode);
_currentAnimationName = animationName;
if (_currentState == null)
{