Change animation logic to using channer act
This commit is contained in:
@@ -59,7 +59,7 @@ namespace BrewMonster
|
||||
}
|
||||
previousAnimationName = @event.AnimationName;
|
||||
InternalPlayAnimation(@event.AnimationName, @event.ITransTime, FadeMode, @event.IsLoop);
|
||||
ApplyAnimationEndCallbacks(@event.AttackEvent, @event.ChannelAct, @event.Rank);
|
||||
ApplyAnimationEndCallbacks(@event.AttackEvent, @event.ChannelAct, @event.Rank, @event.AnimationName);
|
||||
}
|
||||
public void InitPlayerEventDoneHandler()
|
||||
{
|
||||
@@ -228,21 +228,20 @@ namespace BrewMonster
|
||||
_animationList = _animationQueue.Select(q => q.AnimationName).ToList();
|
||||
previousAnimationName = animationQueue.AnimationName;
|
||||
InternalPlayAnimation(animationQueue.AnimationName, animationQueue.ITransTime, FadeMode, animationQueue.IsLoop);
|
||||
ApplyAnimationEndCallbacks(animationQueue.AttackEvent, animationQueue.ChannelAct, animationQueue.Rank);
|
||||
ApplyAnimationEndCallbacks(animationQueue.AttackEvent, animationQueue.ChannelAct, animationQueue.Rank, animationQueue.AnimationName);
|
||||
}
|
||||
|
||||
private void ApplyAnimationEndCallbacks(CECAttackEvent attackEvent, ChannelAct channelAct, int rank)
|
||||
private void ApplyAnimationEndCallbacks(CECAttackEvent attackEvent, ChannelAct channelAct, int rank, string animationName)
|
||||
{
|
||||
if (_currentState == null) return;
|
||||
_currentState.Events.OnEnd = () =>
|
||||
{
|
||||
if (attackEvent != null)
|
||||
attackEvent.m_bSignaled = true;
|
||||
channelAct.GetNodeByRank((byte)rank).m_pActive.m_EventNames.Remove(_currentAnimationName);
|
||||
if(channelAct.GetNodeByRank((byte)rank).m_pActive.IsAllActionFinished)
|
||||
{
|
||||
//channelAct.RemoveNodeByRank((byte)rank);
|
||||
}
|
||||
if (channelAct == null || string.IsNullOrEmpty(animationName))
|
||||
return;
|
||||
var node = channelAct.GetNodeByRank((byte)rank);
|
||||
node?.m_pActive?.m_ActionNames?.Remove(animationName);
|
||||
};
|
||||
}
|
||||
void ApplyDamage()
|
||||
|
||||
Reference in New Issue
Block a user