You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0 KiB

1 month ago
using System.Collections.Generic;
using CoreGame;
using Entitas;
using GAS.Runtime;
namespace CoreGame.Render.System
{
public class AnimancerTickSys : IExecuteSystem
{
private readonly IGroup<CombatEntity> m_AnimGroup;
private readonly List<CombatEntity> m_CacheEntities = new();
public AnimancerTickSys(CombatContext context)
{
m_AnimGroup = context.GetGroup(CombatMatcher.AnimationProxy);
}
public void Execute(float deltaTime)
{
if (deltaTime < BattleConst.Epsilon)
return;
m_AnimGroup.GetEntities(m_CacheEntities);
for (var i = 0; i < m_CacheEntities.Count; i++)
{
var ent = m_CacheEntities[i];
var animProxy = ent.animationProxy;
var tagAggregator = ent.TagCountContainer;
if (tagAggregator.HasTag(GTagLib.State_StandStill))
continue;
animProxy.Tick(deltaTime);
}
}
}
}