Exemplo n.º 1
0
    protected override void OnUpdate()
    {
        if (!itialized)
        {
            return;
        }

        WholeProgressParticlesCollectorSystem.collectJobHandle.Complete();
        var progressData = WholeProgressParticlesCollectorSystem.triggeredProjectiles;

        ProgressData data;

        while (progressData.TryDequeue(out data))
        {
            progress?.IncreaceProgressInPlace(data.damage, data.position);
        }
    }
Exemplo n.º 2
0
    protected override void OnUpdate()
    {
        if (!itialized)
        {
            return;
        }

        var manager = EntityManager;

        var query = GetEntityQuery(
            ComponentType.ReadOnly <Translation>(),
            ComponentType.ReadOnly <SwordsmanTagComponentData>(),
            ComponentType.ReadOnly <MeleeAttackComponentData>(),
            ComponentType.ReadOnly <FactionComponentData>()
            );

        var translation = query.ToComponentDataArray <Translation>(Allocator.TempJob);
        var faction     = query.ToComponentDataArray <FactionComponentData>(Allocator.TempJob);
        var attack      = query.ToComponentDataArray <MeleeAttackComponentData>(Allocator.TempJob);
        var entities    = query.ToEntityArray(Allocator.TempJob);

        for (int i = 0; i < faction.Length; i++)
        {
            if (faction[i].value != FactionComponentData.Faction.ALLY)
            {
                continue;
            }
            if (!attack[i].attackEventFlag)
            {
                continue;
            }

            progress?.IncreaceProgressInPlace(attack[i].damage, translation[i].Value);
        }

        faction.Dispose();
        attack.Dispose();
        translation.Dispose();
        entities.Dispose();
    }
Exemplo n.º 3
0
    protected override void OnUpdate()
    {
        if (!itialized)
        {
            return;
        }

        var detectedActionEntities = new NativeQueue <IncreaceProgressData>(Allocator.TempJob);

        new DetectAnimaionActionJob()
        {
            detectedActionEntities = detectedActionEntities.AsParallelWriter()
        }.Schedule(this).Complete();

        IncreaceProgressData data;

        while (detectedActionEntities.TryDequeue(out data))
        {
            progress?.IncreaceProgressInPlace(data.damage, data.position);
        }

        detectedActionEntities.Dispose();
    }
 public void IncreaceProgress()
 {
     progress?.IncreaceProgressInPlace(damage, applyPosition.position);
 }