|
|
|
|
|
|
using UnityEngine; |
|
|
|
using Unity.Collections; |
|
|
|
using Unity.Mathematics; |
|
|
|
using Unity.Jobs; |
|
|
|
public class BallGoalCheckSystem : ComponentSystem |
|
|
|
public class BallGoalCheckSystem : JobComponentSystem |
|
|
|
protected override void OnUpdate() |
|
|
|
protected override JobHandle OnUpdate(JobHandle inputDeps) |
|
|
|
Entities.WithAll<BallTag>().ForEach((Entity entity, ref Translation trans) => |
|
|
|
{ |
|
|
|
Entities |
|
|
|
.WithAll<BallTag>() |
|
|
|
.WithStructuralChanges() |
|
|
|
.ForEach((Entity entity, ref Translation trans) => |
|
|
|
{ |
|
|
|
float3 pos = trans.Value; |
|
|
|
float bound = GameManager.main.xBound; |
|
|
|
|
|
|
|
|
|
|
PostUpdateCommands.DestroyEntity(entity); |
|
|
|
EntityManager.DestroyEntity(entity); |
|
|
|
PostUpdateCommands.DestroyEntity(entity); |
|
|
|
EntityManager.DestroyEntity(entity); |
|
|
|
}); |
|
|
|
}).Run(); |
|
|
|
|
|
|
|
return inputDeps; |
|
|
|
} |
|
|
|
} |