private void InternalSetUp(SelectionCache cache, VehicleProfiles profile, int size) { this.cache = cache; this.profile = profile; entities = new NativeArray <Entity>(size, Allocator.Persistent); entityManager = World.Active.GetExistingManager <EntityManager>(); Archetype = entityManager.CreateArchetype( typeof(IntId), typeof(FloatId), typeof(VehicleMovement), typeof(VehiclePhysics), typeof(RigidbodyInstance), typeof(PlayerInput), typeof(VehicleSpeed), typeof(HoverPoints), typeof(Position), typeof(Rotation), typeof(TransformMatrix), typeof(PlayerCamera), typeof(ColliderInstances) ); entityManager.CreateEntity(Archetype, entities); SetUp(size); }
public VehicleEntityHelper(SelectionCache cache, VehicleProfiles profile, int size) { InternalSetUp(cache, profile, size); }
// TODO: Make a set up method to avoid copying the code. #if UNITY_EDITOR public VehicleEntityHelper(SelectionCache cache, VehicleProfiles profile, int size, bool debug) { DebugVelocity = debug; InternalSetUp(cache, profile, size); }