Example #1
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)
                }
            });
        }
Example #2
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)
                }
            });
        }
        protected override void OnCreate()
        {
            m_BuildPhysicsWorldSystem = World.GetOrCreateSystem <BuildPhysicsWorld>();
            m_StepPhysicsWorldSystem  = World.GetOrCreateSystem <StepPhysicsWorld>();
            m_EndFramePhysicsSystem   = World.GetOrCreateSystem <EndFramePhysicsSystem>();

            m_SharedData = SharedData.Create();
        }
        protected override void OnCreate()
        {
            HandlesToWaitFor = new NativeList <JobHandle>(16, Allocator.Persistent);

            m_BuildPhysicsWorld  = World.GetOrCreateSystem <BuildPhysicsWorld>();
            m_StepPhysicsWorld   = World.GetOrCreateSystem <StepPhysicsWorld>();
            m_ExportPhysicsWorld = World.GetOrCreateSystem <ExportPhysicsWorld>();
        }
        protected override void OnCreate()
        {
            m_BuildPhysicsWorldSystem = World.GetOrCreateSystem <BuildPhysicsWorld>();
            m_EndFramePhysicsSystem   = World.GetOrCreateSystem <EndFramePhysicsSystem>();

            m_SharedData = SharedData.Create();

#if !ENABLE_UNITY_COLLECTIONS_CHECKS
            // Calling RequireForUpdate will mean that the system will not be updated if there are no dynamic bodies.
            // However, if we are performing want collider integrity checks we need the system to run regardless.
            RequireForUpdate(m_BuildPhysicsWorldSystem.DynamicEntityGroup);
#endif
        }
Example #6
0
        protected override void OnCreate()
        {
            m_BuildPhysicsWorldSystem = World.GetOrCreateSystem <BuildPhysicsWorld>();

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

            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."));

            base.OnCreate();
        }
Example #7
0
 protected override void OnCreateManager()
 {
     m_BuildPhysicsWorldSystem = World.GetOrCreateManager <BuildPhysicsWorld>();
     m_StepPhysicsWorldSystem  = World.GetOrCreateManager <StepPhysicsWorld>();
 }
Example #8
0
        protected override void OnCreate()
        {
            m_OutputDependency = Dependency;

            m_BuildPhysicsWorldSystem = World.GetOrCreateSystem <BuildPhysicsWorld>();
        }