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) } }); }
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) } }); }