Esempio n. 1
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        JobHandle jobHandle = new CollisionEventJob
        {
            bulletGroup = GetComponentDataFromEntity <BulletData>(),
            rockGroup   = GetComponentDataFromEntity <RockData>(),
        }.
        Schedule(stepWorld.Simulation, ref physWorld.PhysicsWorld, inputDeps);

        jobHandle.Complete();
        return(jobHandle);
    }
    protected override void OnUpdate()
    {
        // 初始化 isGround 状态
        // Entities.WithAll<ComsTag>().WithName("InitCollisionState").ForEach((ref AccData accData) =>
        // {
        //     accData.applyAcc = float3.zero;
        //     // collisionStateData.isGround = false;
        // }).ScheduleParallel();
        // Dependency.Complete();

        Dependency = new CollisionEventJob
        {
            PhysicsCustomTagGroup = GetComponentDataFromEntity <PhysicsCustomTags>(true),
            // CollisionStateDataGroup = GetComponentDataFromEntity<CollisionStateData>(),
            translationGroup = GetComponentDataFromEntity <Translation>(),
        }.Schedule(m_StepPhysicsWorldSystem.Simulation, ref m_BuildPhysicsWorldSystem.PhysicsWorld, Dependency);
        Dependency.Complete();
    }