Beispiel #1
0
 /// <summary>
 /// Remove this eventually and have no coupling
 /// </summary>
 private void InduceMoreThenNecessaryCouplingOfSystems()
 {
     movementSystemGroup.CombineWithVoxels(voxelSystemGroup);
     // Voxels
     voxelSystemGroup.characterRaycastSystem.cameraSystem   = cameraSystemGroup.cameraSystem;
     voxelSystemGroup.chunkSpawnSystem.characterDeathSystem = characterSystemGroup.characterDeathSystem;
     voxelSystemGroup.CombineWithCameras(cameraSystemGroup);
     // World
     worldSystemGroup.CombineWithCharacters(characterSystemGroup);
     worldSystemGroup.CombineWithVoxels(voxelSystemGroup);
     worldSystemGroup.CombineWithCameras(cameraSystemGroup);
     // cameras
     cameraSystemGroup.CombineWithCharacters(characterSystemGroup);
     cameraSystemGroup.CombineWithPlayers(playerSystemGroup);
     // bullets
     bulletSystemGroup.CombineWithCharacters(characterSystemGroup);
     bulletSystemGroup.CombineWithSkills(skillSystemGroup);
     // items
     itemSystemGroup.CombineWithAnimation(animationSystemGroup);
     itemSystemGroup.CombineWithUI(uiSystemGroup);
     // skills
     skillSystemGroup.CombineWithCharacters(characterSystemGroup);
     skillSystemGroup.CombineWithUI(uiSystemGroup);
     skillSystemGroup.CombineWithBullets(bulletSystemGroup);
     // Stats
     statSystemGroup.CombineWithUI(uiSystemGroup);
     // Players
     playerSystemGroup.CombineWithUI(uiSystemGroup);
     playerSystemGroup.CombineWithGame(gameSystemGroup);
     // UI
     uiSystemGroup.CombineWithCharacters(characterSystemGroup);
     uiSystemGroup.CombineWithVoxels(voxelSystemGroup);
     uiSystemGroup.CombineWithCameras(cameraSystemGroup);
     uiSystemGroup.CombineWithPlayers(playerSystemGroup);
     uiSystemGroup.CombineWithGame(gameSystemGroup);
     // AI
     aiSystemGroup.CombineWithCharacters(characterSystemGroup);
     // characters
     characterSystemGroup.CombineWithSkills(skillSystemGroup);
     characterSystemGroup.CombineWithUI(uiSystemGroup);
     characterSystemGroup.CombineWithVoxels(voxelSystemGroup);
     characterSystemGroup.CombineWithItems(itemSystemGroup);
     characterSystemGroup.CombineWithPlayers(playerSystemGroup);
     characterSystemGroup.CombineWithCameras(cameraSystemGroup);
     characterSystemGroup.CombineWithGame(gameSystemGroup);
     // Game
     gameSystemGroup.CombineWithPlayers(playerSystemGroup);
     gameSystemGroup.CombineWithVoxels(voxelSystemGroup);
     gameSystemGroup.CombineWithCharacters(characterSystemGroup);
     gameSystemGroup.CombineWithCameras(cameraSystemGroup);
     gameSystemGroup.CombineWithUI(uiSystemGroup.menuSpawnSystem, playerSystemGroup.gameUISystem);
     gameSystemGroup.CombinWithMovement(movementSystemGroup);
     gameSystemGroup.gameStartSystem.boss = this;    // for clearing gmames
 }
Beispiel #2
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
        }