Ejemplo n.º 1
0
        protected override void OnCreateManager()
        {
            m_BuildPhysicsWorldSystem = World.GetOrCreateManager <BuildPhysicsWorld>();

            Simulation = new DummySimulation();
            RegisterSimulation(SimulationType.NoPhysics, () => new DummySimulation());
            RegisterSimulation(SimulationType.UnityPhysics, () => new Simulation());
            RegisterSimulation(SimulationType.HavokPhysics, () => throw new NotSupportedException("Havok Physics package not present. Available Summer 2019."));

            FinalSimulationJobHandle = new JobHandle();
            FinalJobHandle           = new JobHandle();

            m_Callbacks = new SimulationCallbacks();

            base.OnCreateManager();

            // Needed to keep ComponentSystem active when no Entity has PhysicsStep component
            m_PhysicsEntityGroup = GetComponentGroup(new EntityArchetypeQuery
            {
                All = new ComponentType[]
                {
                    typeof(PhysicsVelocity)
                }
            });
        }
Ejemplo n.º 2
0
        protected override void OnCreate()
        {
            m_BuildPhysicsWorldSystem = World.GetOrCreateSystem <BuildPhysicsWorld>();

#if !NET_DOTS
            Assert.AreEqual(Enum.GetValues(typeof(SimulationType)).Length, k_NumSimulationTypes);
#endif

            Simulation = new DummySimulation();
            RegisterSimulation(SimulationType.NoPhysics, () => new DummySimulation());
            RegisterSimulation(SimulationType.UnityPhysics, () => new Simulation());
            RegisterSimulation(SimulationType.HavokPhysics, () =>
                               throw new NotSupportedException("Havok Physics package not present. Use the package manager to add it."));

            FinalSimulationJobHandle = new JobHandle();
            FinalJobHandle           = new JobHandle();

            m_Callbacks = new SimulationCallbacks();

            base.OnCreate();

            // Needed to keep ComponentSystem active when no Entity has PhysicsStep component
            m_PhysicsEntityGroup = GetEntityQuery(new EntityQueryDesc
            {
                All = new ComponentType[]
                {
                    typeof(PhysicsVelocity)
                }
            });
        }
Ejemplo n.º 3
0
 public SimulationJobHandles ScheduleStepJobs(SimulationStepInput input, SimulationCallbacks callbacks, JobHandle inputDeps, int threadCountHint = 0) =>
 new SimulationJobHandles(inputDeps);
Ejemplo n.º 4
0
 public SimulationJobHandles ScheduleStepJobs(SimulationStepInput input, SimulationCallbacks callbacks, JobHandle inputDeps, bool multiThreaded = true) =>
 new SimulationJobHandles(inputDeps);