Example #1
0
        private void Awake()
        {
            Assert.IsNotNull(template, "No Camera found!");
            Assert.IsNotNull(playerPool, "No PlayerPool found!");
            Assert.IsNotNull(cache, "No SelectionCache found!");

            PlayerPool            = playerPool;
            VehicleSelectionCache = cache;

            // TODO: Uncomment
            ECSUtils.DisableSystems(typeof(GameplayPlayerPhysicsMoveSystem), typeof(GameplayPlayerHoverSystem));

#if UNITY_EDITOR
            ECSUtils.DisableSystems(typeof(Derby.Tests.CameraTestSystem), typeof(Derby.Tests.CameraTransformUpdater));
#endif
        }
        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);
        }