protected override void OnUpdate()
        {
            if (!(HasSingleton <PhysicsDebugDisplayData>() && GetSingleton <PhysicsDebugDisplayData>().DrawJoints != 0))
            {
                return;
            }

            var handle = JobHandle.CombineDependencies(Dependency, m_BuildPhysicsWorldSystem.GetOutputDependency());

#pragma warning disable 618
            handle = new DisplayJointsJob
            {
                OutputStream = m_DebugStreamSystem.GetContext(1),
                Bodies       = m_BuildPhysicsWorldSystem.PhysicsWorld.Bodies,
                Joints       = m_BuildPhysicsWorldSystem.PhysicsWorld.Joints
            }.Schedule(handle);
#pragma warning restore 618

            m_StepPhysicsWorldSystem.AddInputDependency(handle);

            // Add dependency for end frame system as well as some test systems might have disabled the step system
            m_EndFramePhysicsSystem.AddInputDependency(handle);

            Dependency = handle;
        }
Exemplo n.º 2
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            if (!(HasSingleton <PhysicsDebugDisplayData>() && GetSingleton <PhysicsDebugDisplayData>().DrawJoints != 0))
            {
                return(inputDeps);
            }

            inputDeps = JobHandle.CombineDependencies(inputDeps, m_BuildPhysicsWorldSystem.FinalJobHandle);

            JobHandle handle = new DisplayJointsJob
            {
                OutputStream = m_DebugStreamSystem.GetContext(1),
                Bodies       = m_BuildPhysicsWorldSystem.PhysicsWorld.Bodies,
                Joints       = m_BuildPhysicsWorldSystem.PhysicsWorld.Joints
            }.Schedule(inputDeps);

            m_EndFramePhysicsSystem.HandlesToWaitFor.Add(handle);

            return(handle);
        }