Example #1
0
        public void Initialize(Unity.Entities.World space)
        {
            // stat bars
            cameraOrbitStartSystem = space.GetOrCreateSystem <CameraOrbitStartSystem>();
            AddSystemToUpdateList(cameraOrbitStartSystem);

            cameraSystem = space.GetOrCreateSystem <CameraSystem>();
            AddSystemToUpdateList(cameraSystem);

            cameraInputSystem = space.GetOrCreateSystem <CameraInputSystem>();
            AddSystemToUpdateList(cameraInputSystem);
            cameraMovementSystem = space.GetOrCreateSystem <CameraMovementSystem>();
            AddSystemToUpdateList(cameraMovementSystem);
            cameraFollowSystem = space.GetOrCreateSystem <CameraFollowSystem>();
            AddSystemToUpdateList(cameraFollowSystem);

            characterToCameraSystem = space.GetOrCreateSystem <CharacterToCameraSystem>();
            AddSystemToUpdateList(characterToCameraSystem);
            cameraFirstPersonSystem = space.GetOrCreateSystem <CameraFirstPersonSystem>();
            AddSystemToUpdateList(cameraFirstPersonSystem);
            cameraSynchSystem = space.GetOrCreateSystem <CameraSynchSystem>();
            AddSystemToUpdateList(cameraSynchSystem);

            //cameraProxySystem = space.GetOrCreateSystem<CameraProxySystem>();
            //AddSystemToUpdateList(cameraProxySystem);
            cameraOrbitSystem = space.GetOrCreateSystem <CameraOrbitSystem>();
            AddSystemToUpdateList(cameraOrbitSystem);
            cameraFacerSystem = space.GetOrCreateSystem <CameraFacerSystem>();
            AddSystemToUpdateList(cameraFacerSystem);
            SetLinks();
        }
Example #2
0
        public void Initialize(Unity.Entities.World space)
        {
            targetSystem        = space.GetOrCreateSystem <TargetSeekSystem>();
            aiStateSystem       = space.GetOrCreateSystem <AIStateSystem>();
            wanderSystem        = space.GetOrCreateSystem <WanderSystem>();
            moveToSystem        = space.GetOrCreateSystem <MoveToSystem>();
            rotateToSystem      = space.GetOrCreateSystem <RotateToSystem>();
            brainSystem         = space.GetOrCreateSystem <BrainSystem>();
            aimSystem           = space.GetOrCreateSystem <AimSystem>();
            followTargetSystem  = space.GetOrCreateSystem <FollowTargetSystem>();
            targetTrackerSystem = space.GetOrCreateSystem <TargetTrackerSystem>();
            AddSystemToUpdateList(targetTrackerSystem);

            AddSystemToUpdateList(targetSystem);
            AddSystemToUpdateList(aiStateSystem);
            AddSystemToUpdateList(wanderSystem);
            AddSystemToUpdateList(moveToSystem);
            AddSystemToUpdateList(rotateToSystem);
            AddSystemToUpdateList(brainSystem);
            AddSystemToUpdateList(aimSystem);
            AddSystemToUpdateList(followTargetSystem);

            nearbyCharactersSystem = space.GetOrCreateSystem <NearbyCharactersSystem>();
            AddSystemToUpdateList(nearbyCharactersSystem);
            SetLinks();
        }
Example #3
0
 public void Initialize(Unity.Entities.World space)
 {
     characterSpawnSystem = space.GetOrCreateSystem <CharacterSpawnSystem>();
     characterDeathSystem = space.GetOrCreateSystem <CharacterDeathSystem>();
     turretSpawnSystem    = space.GetOrCreateSystem <TurretSpawnerSystem>();
     AddSystemToUpdateList(characterSpawnSystem);
     AddSystemToUpdateList(characterDeathSystem);
     AddSystemToUpdateList(turretSpawnSystem);
     SetLinks();
 }
Example #4
0
        public void Initialize(Unity.Entities.World space)
        {
            positionalForceSystem = space.GetOrCreateSystem <PositionalForceSystem>();
            rotationalForceSystem = space.GetOrCreateSystem <RotationalForceSystem>();
            AddSystemToUpdateList(positionalForceSystem);
            AddSystemToUpdateList(rotationalForceSystem);
            separationSystem = space.GetOrCreateSystem <SeparationSystem>();
            AddSystemToUpdateList(separationSystem);
            voxelCollisionSystem = space.GetOrCreateSystem <VoxelCollisionSystem>();
            AddSystemToUpdateList(voxelCollisionSystem);
            worldBoundSystem = space.GetOrCreateSystem <WorldBoundSystem>();
            AddSystemToUpdateList(worldBoundSystem);
            fallSystem = space.GetOrCreateSystem <FallSystem>();
            AddSystemToUpdateList(fallSystem);
            characterVoxelPositionSystem = space.GetOrCreateSystem <CharacterVoxelPositionSystem>();
            AddSystemToUpdateList(characterVoxelPositionSystem);

            //if (Bootstrap.DebugColliders)
            if (Bootstrap.instance != null && Bootstrap.instance.DebugColliders)
            {
                debugColliderSystem = space.GetOrCreateSystem <DebugColliderSystem>();
                AddSystemToUpdateList(debugColliderSystem);
                debugBoneSystem = space.GetOrCreateSystem <DebugBoneSystem>();
                AddSystemToUpdateList(debugBoneSystem);
            }
        }
Example #5
0
 public void Initialize(Unity.Entities.World space)
 {
     bulletSpawnSystem        = space.GetOrCreateSystem <BulletSpawnSystem>();
     bulletDamageSystem       = space.GetOrCreateSystem <BulletHitSystem>();
     bulletHitCompleterSystem = space.GetOrCreateSystem <BulletHitCompleterSystem>();
     bulletDeathSystem        = space.GetOrCreateSystem <BulletDeathSystem>();
     bulletShrinkSystem       = space.GetOrCreateSystem <BulletShrinkSystem>();
     AddSystemToUpdateList(bulletSpawnSystem);
     AddSystemToUpdateList(bulletDamageSystem);
     AddSystemToUpdateList(bulletHitCompleterSystem);
     AddSystemToUpdateList(bulletDeathSystem);
     AddSystemToUpdateList(bulletShrinkSystem);
     SetLinks();
 }
Example #6
0
        void InitECS()
        {
            types = new List <Type>();
            types.Add(typeof(VoxelSystemGroup));
            types.Add(typeof(WorldSystemGroup));
            types.AddRange(SystemsManager.GetUnityTypes());
            space = SystemsManager.CreateEditorWorld(types, "MapMaker");
            var voxelSystemGroup = space.GetOrCreateSystem <VoxelSystemGroup>();
            var worldSystemGroup = space.GetOrCreateSystem <WorldSystemGroup>();

            worldSystemGroup.Initialize(space);
            voxelSystemGroup.Initialize(space);
            worldSystemGroup.CombineWithVoxels(voxelSystemGroup);
            voxelSystemGroup.SetMeta(gameData);
            Debug.Log("Adding Update Method from MapMaker.");
            EditorApplication.update += UpdateEditorWindow;
        }
Example #7
0
 public void OnDisable()
 {
     Debug.Log("Removing Update Method from MapMaker.");
     EditorApplication.update -= UpdateEditorWindow;
     //ClearMap();
     //systemsManager.Clear();
     if (space != null)
     {
         if (space.IsCreated)
         {
             space.GetOrCreateSystem <VoxelSystemGroup>().Clear();
             space.Dispose();
         }
         space = null;
         //EditorApplication.update -= UpdateEditorWindow;
         //Repaint();
     }
 }
Example #8
0
        void FetchMesh()
        {
            Unity.Entities.EntityManager entityManager    = space.EntityManager;
            ChunkSpawnSystem             chunkSpawnSystem = space.GetOrCreateSystem <VoxelSystemGroup>().chunkSpawnSystem;

            foreach (KeyValuePair <int, Unity.Entities.Entity> KVP in chunkSpawnSystem.chunks)
            {
                Chunk chunk = entityManager.GetComponentData <Chunk>(KVP.Value);
                if (chunk.world == world)
                {
                    if (chunk.chunkRenders.Length > 0)
                    {
                        mesh = entityManager.GetSharedComponentData <Unity.Rendering.RenderMesh>(chunk.chunkRenders[0]).mesh;
                    }
                    else
                    {
                        Debug.LogError("No chunk renders in chunk: " + chunk.Value.chunkPosition);
                    }
                    break;
                }
            }
        }
Example #9
0
        private void InitECS()
        {
            if (space != null)
            {
                return;
            }
            types = new List <Type>();
            types.Add(typeof(VoxelSystemGroup));
            types.Add(typeof(WorldSystemGroup));
            types.AddRange(SystemsManager.GetUnityTypes());
            space = SystemsManager.CreateWorld(types, "Zaker");
            VoxelSystemGroup voxelSystemGroup = space.GetOrCreateSystem <VoxelSystemGroup>();
            WorldSystemGroup worldSystemGroup = space.GetOrCreateSystem <WorldSystemGroup>();

            worldSystemGroup.Initialize(space);
            voxelSystemGroup.Initialize(space);
            worldSystemGroup.CombineWithVoxels(voxelSystemGroup);
            voxelSystemGroup.SetMeta(gameDatam);
            EditorApplication.update += UpdateEditorWindow;
            // add camera systems
            // zoom into mesh
            // Add render texture of camera to this UI
        }
Example #10
0
 public void Initialize(Unity.Entities.World space)
 {
     controllerSystem       = space.GetOrCreateSystem <ControllerSystem>();
     playerControllerSystem = space.GetOrCreateSystem <PlayerInputSystem>();
     playerSkillsSystem     = space.GetOrCreateSystem <PlayerSkillsSystem>();
     AddSystemToUpdateList(controllerSystem);
     AddSystemToUpdateList(playerControllerSystem);
     AddSystemToUpdateList(playerSkillsSystem);
     playerSpawnSystem = space.GetOrCreateSystem <PlayerSpawnSystem>();
     AddSystemToUpdateList(playerSpawnSystem);
     cursorStateSystem = space.GetOrCreateSystem <CursorStateSystem>();
     AddSystemToUpdateList(cursorStateSystem);
     gameUISystem = space.GetOrCreateSystem <GameUISystem>();
     AddSystemToUpdateList(gameUISystem);
     playerInteractSystem = space.GetOrCreateSystem <PlayerInteractSystem>();
     AddSystemToUpdateList(playerInteractSystem);
 }
Example #11
0
 public void Initialize(Unity.Entities.World space)
 {
     biomeGenerationSystem = space.GetOrCreateSystem <BiomeGenerationSystem>();
     AddSystemToUpdateList(biomeGenerationSystem);
     heightMapGenerationSystem = space.GetOrCreateSystem <HeightMapGenerationSystem>();
     AddSystemToUpdateList(heightMapGenerationSystem);
     chunkMapBiomeBuilderSystem = space.GetOrCreateSystem <ChunkMapBiomeBuilderSystem>();
     AddSystemToUpdateList(chunkMapBiomeBuilderSystem);
     terrainGenerationSystem = space.GetOrCreateSystem <TerrainGenerationSystem>();
     AddSystemToUpdateList(terrainGenerationSystem);
     townGenerationSystem = space.GetOrCreateSystem <TownGenerationSystem>();
     AddSystemToUpdateList(townGenerationSystem);
     worldGenerationStarterSystem = space.GetOrCreateSystem <WorldGenerationStarterSystem>();
     AddSystemToUpdateList(worldGenerationStarterSystem);
     worldGenerationCompleterSystem = space.GetOrCreateSystem <WorldGenerationCompleterSystem>();
     AddSystemToUpdateList(worldGenerationCompleterSystem);
     if (!disableMonsterSpawning)
     {
         monsterSpawnSystem = space.GetOrCreateSystem <MonsterSpawnSystem>();
         AddSystemToUpdateList(monsterSpawnSystem);
     }
 }
Example #12
0
 public void Initialize(Unity.Entities.World space)
 {
     skillsSystem         = space.GetOrCreateSystem <SkillsSystem>();
     damageSystem         = space.GetOrCreateSystem <DamageSystem>();
     shootSystem          = space.GetOrCreateSystem <ShootSystem>();
     shootCompleterSystem = space.GetOrCreateSystem <ShootCompleterSystem>();
     meleeDamageSystem    = space.GetOrCreateSystem <MeleeDamageSystem>();
     meleeCompleterSystem = space.GetOrCreateSystem <MeleeCompleterSystem>();
     AddSystemToUpdateList(skillsSystem);
     AddSystemToUpdateList(damageSystem);
     AddSystemToUpdateList(shootSystem);
     AddSystemToUpdateList(shootCompleterSystem);
     AddSystemToUpdateList(meleeDamageSystem);
     AddSystemToUpdateList(meleeCompleterSystem);
     SetLinks();
 }
Example #13
0
        public void Initialize(Unity.Entities.World space)
        {
            sinRotatorSystem = space.CreateSystem <SinRotatorSystem>();
            AddSystemToUpdateList(sinRotatorSystem);

            animatorSystem           = space.GetOrCreateSystem <Zoxel.Animations.AnimatorSystem>();
            animatorEndSystem        = space.GetOrCreateSystem <Zoxel.Animations.AnimatorEndSystem>();
            shrinkSystem2            = space.GetOrCreateSystem <ShrinkSystem2>();
            shrinkSystem3            = space.GetOrCreateSystem <ShrinkSystem3>();
            lerpPositionSystem       = space.GetOrCreateSystem <LerpPositionSystem>();
            lerpScaleSystem          = space.GetOrCreateSystem <LerpScaleSystem>();
            lerpPositionEntitySystem = space.GetOrCreateSystem <LerpPositionEntitySystem>();
            doomedToDieSystem        = space.GetOrCreateSystem <DoomedToDieSystem>();
            AddSystemToUpdateList(animatorSystem);
            AddSystemToUpdateList(animatorEndSystem);
            AddSystemToUpdateList(shrinkSystem2);
            AddSystemToUpdateList(shrinkSystem3);
            AddSystemToUpdateList(lerpPositionSystem);
            AddSystemToUpdateList(lerpScaleSystem);
            AddSystemToUpdateList(lerpPositionEntitySystem);
            AddSystemToUpdateList(doomedToDieSystem);

            SetLinks();
        }
Example #14
0
        public void Initialize(Unity.Entities.World space)
        {
            itemSpawnSystem        = space.GetOrCreateSystem <ItemSpawnerSystem>();
            itemHitSystem          = space.GetOrCreateSystem <ItemHitSystem>();
            itemHitCompleterSystem = space.GetOrCreateSystem <ItemHitCompleterSystem>();
            itemBobSystem          = space.GetOrCreateSystem <ItemBobSystem>();
            AddSystemToUpdateList(itemSpawnSystem);
            AddSystemToUpdateList(itemHitSystem);
            AddSystemToUpdateList(itemHitCompleterSystem);
            AddSystemToUpdateList(itemBobSystem);
            equipmentSystem = space.GetOrCreateSystem <EquipmentSystem>();
            AddSystemToUpdateList(equipmentSystem);

            itemUISystem = space.GetOrCreateSystem <ItemUISystem>();
            AddSystemToUpdateList(itemUISystem);

            SetLinks();
        }
Example #15
0
 public void Initialize(Unity.Entities.World space)
 {
     //regenStartSystem = space.GetOrCreateSystem<RegenStartSystem>();
     regenSystem          = space.GetOrCreateSystem <RegenSystem>();
     regenCompleterSystem = space.GetOrCreateSystem <RegenCompleterSystem>();
     levelUpSystem        = space.GetOrCreateSystem <LevelUpSystem>();
     levelUpEffectsSystem = space.GetOrCreateSystem <LevelUpEffectsSystem>();
     attributesSystem     = space.GetOrCreateSystem <AttributesSystem>();
     //AddSystemToUpdateList(regenStartSystem);
     AddSystemToUpdateList(regenSystem);
     AddSystemToUpdateList(regenCompleterSystem);
     AddSystemToUpdateList(levelUpSystem);
     AddSystemToUpdateList(levelUpEffectsSystem);
     AddSystemToUpdateList(attributesSystem);
     statUpdateSystem = space.GetOrCreateSystem <StatUpdateSystem>();
     AddSystemToUpdateList(statUpdateSystem);
     SetLinks();
 }
Example #16
0
        private void CreateSystemGroups()
        {
            worldSystemGroup = space.GetOrCreateSystem <WorldSystemGroup>();
            worldSystemGroup.Initialize(space);
            voxelSystemGroup = space.GetOrCreateSystem <VoxelSystemGroup>();
            voxelSystemGroup.Initialize(space);
            movementSystemGroup = space.GetOrCreateSystem <MovementSystemGroup>();
            movementSystemGroup.Initialize(space);
            uiSystemGroup = space.GetOrCreateSystem <UISystemGroup>();
            uiSystemGroup.Initialize(space);
            playerSystemGroup = space.GetOrCreateSystem <PlayerSystemGroup>();
            playerSystemGroup.Initialize(space);
            gameSystemGroup = space.GetOrCreateSystem <GameSystemGroup>();
            gameSystemGroup.Initialize(space);
            cameraSystemGroup = space.GetOrCreateSystem <CameraSystemGroup>();
            cameraSystemGroup.Initialize(space);
            bulletSystemGroup = space.GetOrCreateSystem <BulletSystemGroup>();
            bulletSystemGroup.Initialize(space);
            characterSystemGroup = space.GetOrCreateSystem <CharacterSystemGroup>();
            characterSystemGroup.Initialize(space);
            skillSystemGroup = space.GetOrCreateSystem <SkillSystemGroup>();
            skillSystemGroup.Initialize(space);
            statSystemGroup = space.GetOrCreateSystem <StatSystemGroup>();
            statSystemGroup.Initialize(space);
            itemSystemGroup = space.GetOrCreateSystem <ItemSystemGroup>();
            itemSystemGroup.Initialize(space);
            animationSystemGroup = space.GetOrCreateSystem <AnimationSystemGroup>();
            animationSystemGroup.Initialize(space);
            aiSystemGroup = space.GetOrCreateSystem <AISystemGroup>();
            aiSystemGroup.Initialize(space);

            //var presentationGroup = space.GetOrCreateSystem<PresentationSystemGroup>();
            //var renderBoundsUpdateSystem = space.GetOrCreateSystem<Zoxel.RenderBoundsUpdateSystem>();
            //presentationGroup.AddSystemToUpdateList(renderBoundsUpdateSystem);
            //var renderBoundsUpdateSystem = space.GetOrCreateSystem<CreateMissingRenderBoundsFromMeshRenderer>();
            //presentationGroup.AddSystemToUpdateList(createMissingRenderBoundsFromMeshRenderer);
        }
Example #17
0
    private static Unity.Entities.World GetOrCreateWorld()
    {
        if (Unity.Entities.World.DefaultGameObjectInjectionWorld != null && Unity.Entities.World.DefaultGameObjectInjectionWorld.Name == "KodeboldsWorld")
        {
            return(Unity.Entities.World.DefaultGameObjectInjectionWorld);
        }

        Unity.Entities.World world = new Unity.Entities.World("KodeboldsWorld");
        Unity.Entities.World.DefaultGameObjectInjectionWorld = world;

        //INITIALISATION
        Unity.Entities.InitializationSystemGroup initSystemGroup = world.GetOrCreateSystem <Unity.Entities.InitializationSystemGroup>();

        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Entities.BeginInitializationEntityCommandBufferSystem>());
        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Entities.ConvertToEntitySystem>());
        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <CameraSyncSystem>());
        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <InputManagementSystem>());
        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <InstantiationSystem>());
        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <SpawningSystem>());
        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Entities.RetainBlobAssetSystem>());
        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Entities.UpdateWorldTimeSystem>());

        {
            Unity.Scenes.SceneSystemGroup sceneSystemGroup = world.GetOrCreateSystem <Unity.Scenes.SceneSystemGroup>();
            initSystemGroup.AddSystemToUpdateList(sceneSystemGroup);

            sceneSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Scenes.SceneSystem>());
            sceneSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Scenes.ResolveSceneReferenceSystem>());
            sceneSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Scenes.SceneSectionStreamingSystem>());
        }

        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.CopyInitialTransformFromGameObjectSystem>());

        //Must run after CopyInitialTransformFromGameObjectSystem.
        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <FreezeRotationSystem>());

        initSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Entities.EndInitializationEntityCommandBufferSystem>());

        //SIMULATION
        Unity.Entities.SimulationSystemGroup simSystemGroup = world.GetOrCreateSystem <Unity.Entities.SimulationSystemGroup>();


        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Entities.BeginSimulationEntityCommandBufferSystem>());
        //simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem<DebugStream>()); //Unity system, they just didn't put it in a namespace hurr durr.
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Systems.BuildPhysicsWorld>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Authoring.DisplayJointsSystem>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Systems.StepPhysicsWorld>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Systems.ExportPhysicsWorld>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Authoring.DisplayContactsSystem>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Authoring.DisplayBroadphaseAabbsSystem>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Authoring.DisplayColliderAabbsSystem>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Authoring.DisplayBodyColliders>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Authoring.DisplayCollisionEventsSystem>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Authoring.DisplayContactsSystem>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Authoring.DisplayMassPropertiesSystem>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Authoring.DisplayTriggerEventsSystem>());
        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Physics.Systems.EndFramePhysicsSystem>());

        {
            PostPhysicsSystemsGroup postPhysicsSystemsGroup = world.GetOrCreateSystem <PostPhysicsSystemsGroup>();
            simSystemGroup.AddSystemToUpdateList(postPhysicsSystemsGroup);

            postPhysicsSystemsGroup.AddSystemToUpdateList(world.GetOrCreateSystem <RaycastSystem>());
            postPhysicsSystemsGroup.AddSystemToUpdateList(world.GetOrCreateSystem <SpawningQueueSystem>());
            postPhysicsSystemsGroup.AddSystemToUpdateList(world.GetOrCreateSystem <SelectionSystem>());
            postPhysicsSystemsGroup.AddSystemToUpdateList(world.GetOrCreateSystem <CameraControlSystem>());
            postPhysicsSystemsGroup.AddSystemToUpdateList(world.GetOrCreateSystem <HarvestingSystem>());
            postPhysicsSystemsGroup.AddSystemToUpdateList(world.GetOrCreateSystem <DepositSystem>());
            postPhysicsSystemsGroup.AddSystemToUpdateList(world.GetOrCreateSystem <UnitMoveSystem>());
        }

        {
            //These systems must be updated after all the game logic systems as state transitions add/remove components via an entity command buffer, meaning the command status data
            //will be out of sync with the state components until the next sync point (command buffer system).
            //We do this step at the end to avoid an additional sync point that would halt the main thread.
            CommandStateProcessingSystemsGroup commandStateProcessingSystemsGroup = world.GetOrCreateSystem <CommandStateProcessingSystemsGroup>();
            simSystemGroup.AddSystemToUpdateList(commandStateProcessingSystemsGroup);

            commandStateProcessingSystemsGroup.AddSystemToUpdateList(world.GetOrCreateSystem <FindAITargetSystem>());
            commandStateProcessingSystemsGroup.AddSystemToUpdateList(world.GetOrCreateSystem <CommandProcessSystem>());
            commandStateProcessingSystemsGroup.AddSystemToUpdateList(world.GetOrCreateSystem <StateTransitionSystem>());
        }

        {
            Unity.Transforms.TransformSystemGroup transformSystemGroup = world.GetOrCreateSystem <Unity.Transforms.TransformSystemGroup>();
            simSystemGroup.AddSystemToUpdateList(transformSystemGroup);

            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.CopyTransformFromGameObjectSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.EndFrameCompositeScaleSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.EndFrameParentSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.EndFramePostRotationEulerSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.EndFrameRotationEulerSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.EndFrameCompositeRotationSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.EndFrameParentScaleInverseSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.EndFrameTRSToLocalToParentSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.EndFrameTRSToLocalToWorldSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.EndFrameLocalToParentSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.CopyTransformToGameObjectSystem>());
            transformSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Transforms.EndFrameWorldToLocalSystem>());
        }

        {
            BehaviourUpdaterSystemsGroup behaviourUpdaterSystemsGroup = world.GetOrCreateSystem <BehaviourUpdaterSystemsGroup>();
            simSystemGroup.AddSystemToUpdateList(behaviourUpdaterSystemsGroup);

            m_behaviourUpdaterSystem = world.GetOrCreateSystem <BehaviourUpdaterSystem>();

            behaviourUpdaterSystemsGroup.AddSystemToUpdateList(m_behaviourUpdaterSystem);
        }

        simSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Entities.EndSimulationEntityCommandBufferSystem>());


        //PRESENTATION
        Unity.Entities.PresentationSystemGroup presentationSystemGroup = world.GetOrCreateSystem <Unity.Entities.PresentationSystemGroup>();

        presentationSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Entities.BeginPresentationEntityCommandBufferSystem>());

        {
            Unity.Rendering.StructuralChangePresentationSystemGroup structuralChangePresentationSystemGroup = world.GetOrCreateSystem <Unity.Rendering.StructuralChangePresentationSystemGroup>();
            presentationSystemGroup.AddSystemToUpdateList(structuralChangePresentationSystemGroup);

            structuralChangePresentationSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Rendering.AddWorldAndChunkRenderBounds>());
            structuralChangePresentationSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Rendering.AddLodRequirementComponents>());
        }

        {
            Unity.Rendering.UpdatePresentationSystemGroup updatePresentationSystemGroup = world.GetOrCreateSystem <Unity.Rendering.UpdatePresentationSystemGroup>();
            presentationSystemGroup.AddSystemToUpdateList(updatePresentationSystemGroup);

            updatePresentationSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Rendering.RenderBoundsUpdateSystem>());
            updatePresentationSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Rendering.LodRequirementsUpdateSystem>());
        }

        presentationSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <Unity.Rendering.RenderMeshSystemV2>());
        presentationSystemGroup.AddSystemToUpdateList(world.GetOrCreateSystem <EndFrameJobCompleteSystem>());

        Unity.Entities.ScriptBehaviourUpdateOrder.UpdatePlayerLoop(world);

        return(world);
    }
Example #18
0
        public void Initialize(Unity.Entities.World space)
        {
            // stat bars
            statbarSystem = space.GetOrCreateSystem <StatbarSystem>();
            AddSystemToUpdateList(statbarSystem);
            statBarSystem = space.GetOrCreateSystem <StatbarPositionerSystem>();
            AddSystemToUpdateList(statBarSystem);
            statbarUpdateSystem = space.GetOrCreateSystem <StatBarUpdaterSystem>();
            AddSystemToUpdateList(statbarUpdateSystem);
            trailerPositionerSystem = space.GetOrCreateSystem <TrailerPositionerSystem>();
            AddSystemToUpdateList(trailerPositionerSystem);
            trailerStarterSystem = space.GetOrCreateSystem <TrailerStarterSystem>();
            AddSystemToUpdateList(trailerStarterSystem);
            statbarFaderSystem = space.GetOrCreateSystem <StatBarFaderSystem>();
            AddSystemToUpdateList(statbarFaderSystem);
            damagePopupSystem = space.GetOrCreateSystem <DamagePopupSystem>();
            AddSystemToUpdateList(damagePopupSystem);
            navigateUISystem = space.GetOrCreateSystem <NavigateUISystem>();
            AddSystemToUpdateList(navigateUISystem);
            navigateUICompleterSystem = space.GetOrCreateSystem <NavigateUICompleterSystem>();
            AddSystemToUpdateList(navigateUICompleterSystem);
            gridUISystem = space.GetOrCreateSystem <GridUISystem>();
            AddSystemToUpdateList(gridUISystem);
            navigateStartSystem = space.GetOrCreateSystem <NavigateStartSystem>();
            AddSystemToUpdateList(navigateStartSystem);


            selectedUISystem = space.GetOrCreateSystem <SelectedUISystem>();
            AddSystemToUpdateList(selectedUISystem);
            panelUISystem = space.GetOrCreateSystem <PanelUISystem>();
            AddSystemToUpdateList(panelUISystem);

            // Player UIs
            crosshairSpawnSystem = space.GetOrCreateSystem <CrosshairSpawnSystem>();
            AddSystemToUpdateList(crosshairSpawnSystem);
            actionbarSpawnSystem = space.GetOrCreateSystem <ActionbarSystem>();
            AddSystemToUpdateList(actionbarSpawnSystem);
            inventoryUISpawnSystem = space.GetOrCreateSystem <InventoryUISpawnSystem>();
            AddSystemToUpdateList(inventoryUISpawnSystem);
            equipmentUISpawnSystem = space.GetOrCreateSystem <EquipmentUISpawnSystem>();
            AddSystemToUpdateList(equipmentUISpawnSystem);

            statsUISpawnSystem = space.GetOrCreateSystem <StatsUISpawnSystem>();
            AddSystemToUpdateList(statsUISpawnSystem);

            skillbookUISpawnSystem = space.GetOrCreateSystem <SkillbookUISpawnSystem>();
            AddSystemToUpdateList(skillbookUISpawnSystem);

            dialogueUISpawnSystem = space.GetOrCreateSystem <DialogueUISpawnSystem>();
            AddSystemToUpdateList(dialogueUISpawnSystem);
            dialogueSystem = space.GetOrCreateSystem <DialogueSystem>();
            AddSystemToUpdateList(dialogueSystem);
            questLogUISpawnSystem = space.GetOrCreateSystem <QuestLogUISpawnSystem>();
            AddSystemToUpdateList(questLogUISpawnSystem);
            menuSpawnSystem = space.GetOrCreateSystem <MenuSpawnSystem>();
            AddSystemToUpdateList(menuSpawnSystem);
            renderTextSystem = space.GetOrCreateSystem <RenderTextSystem>();
            AddSystemToUpdateList(renderTextSystem);
            mapUISpawnSystem = space.GetOrCreateSystem <MapUISpawnSystem>();
            AddSystemToUpdateList(mapUISpawnSystem);

            SetLinks();
        }
Example #19
0
        public void Initialize(Unity.Entities.World space)
        {
            // entity spawn
            worldSpawnSystem = space.GetOrCreateSystem <WorldSpawnSystem>();
            AddSystemToUpdateList(worldSpawnSystem);
            chunkSpawnSystem = space.GetOrCreateSystem <ChunkSpawnSystem>();
            AddSystemToUpdateList(chunkSpawnSystem);
            chunkRenderSystem = space.GetOrCreateSystem <ChunkRenderSystem>();
            AddSystemToUpdateList(chunkRenderSystem);
            voxelSpawnSystem = space.GetOrCreateSystem <VoxelSpawnSystem>();
            AddSystemToUpdateList(voxelSpawnSystem);

            // mesh gen
            chunkSideSystem = space.GetOrCreateSystem <ChunkSidesSystem>();
            AddSystemToUpdateList(chunkSideSystem);
            chunkSideCullSystem = space.GetOrCreateSystem <ChunkSideCullingSystem>();
            AddSystemToUpdateList(chunkSideCullSystem);
            chunkToRendererSystem = space.GetOrCreateSystem <ChunkToRendererSystem>();
            AddSystemToUpdateList(chunkToRendererSystem);
            chunkMeshBuildSystem = space.GetOrCreateSystem <ChunkMeshBuilderSystem>();
            AddSystemToUpdateList(chunkMeshBuildSystem);
            chunkMeshEndSystem = space.GetOrCreateSystem <ChunkMeshEndingSystem>();
            AddSystemToUpdateList(chunkMeshEndSystem);

            chunkWeightBuilder = space.GetOrCreateSystem <ChunkWeightBuilder>();
            AddSystemToUpdateList(chunkWeightBuilder);

            // maps
            chunkMapStarterSystem = space.GetOrCreateSystem <ChunkMapStarterSystem>();
            AddSystemToUpdateList(chunkMapStarterSystem);
            chunkMapBuilderSystem = space.GetOrCreateSystem <ChunkMapBuilderSystem>();
            AddSystemToUpdateList(chunkMapBuilderSystem);
            chunkMapCompleterSystem = space.GetOrCreateSystem <ChunkMapCompleterSystem>();
            AddSystemToUpdateList(chunkMapCompleterSystem);

            // player streaming
            worldStreamSystem = space.GetOrCreateSystem <WorldStreamSystem>();
            AddSystemToUpdateList(worldStreamSystem);
            chunkStreamSystem = space.GetOrCreateSystem <ChunkStreamSystem>();
            AddSystemToUpdateList(chunkStreamSystem);
            chunkStreamEndSystem = space.GetOrCreateSystem <ChunkStreamEndSystem>();
            AddSystemToUpdateList(chunkStreamEndSystem);

            // interact
            voxelRaycastSystem = space.GetOrCreateSystem <VoxelRaycastSystem>();
            AddSystemToUpdateList(voxelRaycastSystem);
            voxelPreviewSystem = space.GetOrCreateSystem <VoxelPreviewSystem>();
            AddSystemToUpdateList(voxelPreviewSystem);
            characterRaycastSystem = space.GetOrCreateSystem <CharacterRaycastSystem>();
            AddSystemToUpdateList(characterRaycastSystem);

            renderSystem = space.GetOrCreateSystem <RenderSystem>();
            AddSystemToUpdateList(renderSystem);

            if (Bootstrap.instance.isAnimateRenders)
            {
                chunkRendererAnimationSystem = space.GetOrCreateSystem <ChunkRendererAnimationSystem>();
                AddSystemToUpdateList(chunkRendererAnimationSystem);
            }

            if (Bootstrap.DebugChunks)
            {
                debugChunkSystem = space.GetOrCreateSystem <DebugChunkSystem>();
                AddSystemToUpdateList(debugChunkSystem);
            }
            if (!Bootstrap.isRenderChunks)
            {
                chunkSideSystem.Enabled = false;
            }
            SetLinks();
        }