add chanelact logic

This commit is contained in:
Tran Hai Nam
2026-05-05 16:09:25 +07:00
parent 1341d6ca65
commit 4e99c4f842
10 changed files with 362 additions and 142 deletions
+15 -11
View File
@@ -14,6 +14,8 @@ namespace BrewMonster
public int ITransTime;
public CECAttackEvent AttackEvent;
public bool IsLoop;
public ChannelAct ChannelAct;
public byte Channel;
}
public class PlayerVisual : MonoBehaviour
{
@@ -48,14 +50,16 @@ namespace BrewMonster
{
AnimationName = @event.AnimationName,
IsForceStopPrevious = @event.IsForceStopPrevious,
AttackEvent = @event.AttackEvent
AttackEvent = @event.AttackEvent,
ChannelAct = @event.ChannelAct,
Channel = @event.Channel
});
_animationList = _animationQueue.Select(q => q.AnimationName).ToList();
return;
}
previousAnimationName = @event.AnimationName;
InternalPlayAnimation(@event.AnimationName, @event.ITransTime, FadeMode, @event.IsLoop);
ApplyAttackSignalOnAnimationEnd(@event.AttackEvent);
ApplyAnimationEndCallbacks(@event.AttackEvent, @event.ChannelAct, @event.Channel);
}
public void InitPlayerEventDoneHandler()
{
@@ -156,7 +160,9 @@ namespace BrewMonster
IsForceStopPrevious = @event.IsForceStopPrevious,
ITransTime = @event.ITransTime,
AttackEvent = @event.AttackEvent,
IsLoop = @event.IsLoop
IsLoop = @event.IsLoop,
ChannelAct = @event.ChannelAct,
Channel = @event.Channel
});
_animationList = _animationQueue.Select(q => q.AnimationName).ToList();
if (!isHit)
@@ -222,18 +228,16 @@ namespace BrewMonster
_animationList = _animationQueue.Select(q => q.AnimationName).ToList();
previousAnimationName = animationQueue.AnimationName;
InternalPlayAnimation(animationQueue.AnimationName, animationQueue.ITransTime, FadeMode, animationQueue.IsLoop);
ApplyAttackSignalOnAnimationEnd(animationQueue.AttackEvent);
ApplyAnimationEndCallbacks(animationQueue.AttackEvent, animationQueue.ChannelAct, animationQueue.Channel);
}
private void ApplyAttackSignalOnAnimationEnd(CECAttackEvent attackEvent)
{
if (attackEvent == null || _currentState == null)
{
return;
}
private void ApplyAnimationEndCallbacks(CECAttackEvent attackEvent, ChannelAct channelAct, byte channel)
{
if (_currentState == null) return;
_currentState.Events.OnEnd = () =>
{
attackEvent.m_bSignaled = true;
if (attackEvent != null)
attackEvent.m_bSignaled = true;
};
}
void ApplyDamage()