Пример #1
0
    public UpdateUnitShooting(UnitContext unitContext)
    {
        var idx = new EntityIndex <UnitEntity, int>(
            unitContext.GetGroup(UnitMatcher.Team),
            (entity, component) => {
            var team = component as Team;
            return(team != null ? team.id : entity.team.id);
        });

        unitContext.AddEntityIndex(TARGETS_INDEX_NAME, idx);

        _units    = unitContext;
        _shooters = unitContext.GetGroup(UnitMatcher.Team);
    }
Пример #2
0
 public UpdateShootingCooldown(UnitContext units, GlobalsContext globals)
 {
     _cooldownUnits = units.GetGroup(UnitMatcher.ShootingCooldown);
     _globals       = globals;
 }