Exemple #1
0
#pragma warning restore 649

    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new EnemyAttackJob
        {
            Ecb       = endFrameBarrier.CreateCommandBuffer().ToConcurrent(),
            DeltaTime = Time.deltaTime,
            Health    = GetComponentDataFromEntity <HealthData>(),
            Damaged   = GetComponentDataFromEntity <DamagedData>()
        };

        return(job.Schedule(this, inputDeps));
    }
Exemple #2
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new EnemyAttackJob
        {
            Ecb       = barrier.CreateCommandBuffer().ToConcurrent(),
            DeltaTime = Time.deltaTime,
            HealthUpdatedArchetype = healthUpdatedEventArchetype,
            Health = GetComponentDataFromEntity <HealthData>()
        };

        inputDeps = job.Schedule(this, inputDeps);
        barrier.AddJobHandleForProducer(inputDeps);
        return(inputDeps);
    }