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.
28 lines
849 B
28 lines
849 B
using System;
|
|
using System.Collections.Generic;
|
|
using Entitas;
|
|
using UnityEngine;
|
|
|
|
namespace CoreGame.Render
|
|
{
|
|
public class AbilityTickSystem : IExecuteSystem
|
|
{
|
|
private readonly CombatContext m_Contexts;
|
|
readonly List<CombatEntity> m_CacheEntities = new();
|
|
readonly IGroup<CombatEntity> m_SkillGroup;
|
|
public AbilityTickSystem(CombatContext contexts)
|
|
{
|
|
m_Contexts = contexts;
|
|
m_SkillGroup = m_Contexts.GetGroup(CombatMatcher.AbilitySystem);
|
|
}
|
|
public void Execute(float deltaTime)
|
|
{
|
|
m_SkillGroup.GetEntities(m_CacheEntities);
|
|
for (int i = 0; i < m_CacheEntities.Count; i++)
|
|
{
|
|
var component = m_CacheEntities[i].abilitySystem;
|
|
component.Tick(deltaTime);
|
|
}
|
|
}
|
|
}
|
|
}
|