Exemplo n.º 1
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
        }
Exemplo n.º 2
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);
        }