3D-Tile地图编辑器开发日志 01

目的

建立一套 Runtime 和 Editor 互通编辑的Grid地图编辑器
毕竟什么游戏都会用到。而且市面上的学习成本很高而且不太适合游戏
又没有像2dTile一样能够很好使用的方案

Todo

  1. 限定当前编辑区域组件(MapData
  2. 可以设定特殊事件点
  3. 可以俯视角观看层级
  4. 可以俯视角编辑层级
  5. 优化数据结构
  6. MapData 额外条件
  7. Parent 固定不可删除

借鉴库

blocky-world-editor

2024年还在更新的地编。估计和我有一样的需求
https://github.com/peartreegames/blocky-world-editor?tab=readme-ov-file

Palettes

A collection of IBlockyPieces to place in your scene. Will automatically be added to the dropdown selection.
画笔。每一个砖块

Layers

A composite key for the placement of IBlockyPieces. Layers can be anything you like, but typical layers may include something like Terrain, Props, Water, etc. Essentially groupings where only one GameObject of that layer type can occupy the same space.
图层。更像是唯一标识。每个Layer层只准放一个相同单位

BlockyObject

MonoBehaviour to be added to GameObjects you wish you place.
给预制体添加上才能作为画笔

BlockyRandomizer

Collection of BlockyObjects which will choose one at random. Good for landscaping or rubbish, essentially fast placement of inconsequential items strewn about a level to add texture.
把几个画笔构成笔刷中选择一个。类似小花花。可以有好几种状态

BlockyRuleSet

Collection of BlockyObjects which change based on their neighbours. Good for paths, fences, walls, etc.
区块型画笔。对平台边边角角可以进行同方向优化

blocky-world-editor Tree

  • Editor
    • PeartreeGames.BlockyWorldEditor.Editor 索引
    • WorldPositionViewer 坐标显示工具
    • IBlockyScenePreprocessor
    • BlockyRuleSetEditor
    • BlockyPaletteEditor
    • BlockyEditorWindow 编辑器 工具箱(…….)
    • BlockyEditorUtilities
    • BlockyEditorSettings 编辑文件用于记录上一次编辑的记录
    • BlockyVisualElements 视图元素
      • BlockyRuleDrawer
      • BlockySceneObjectDrawer
      • BlockySettingsElement 设置面板图床
    • BlockyParentSetter
      • BlockyDefaultParentSetter 默认设置层
      • BlockyParentSetter 设置层准备改造成Layer层
    • Attributes
      • BlockyButtonAttribute
      • BlockySceneObjectAttribute
  • Runtime
    • PeartreeGames.BlockyWorldEditor 索引
    • BlockyLayer 脚本无实际功能。作为笔刷集存在
    • BlockyObject 笔刷基础对象,仅在Editor写了函数
    • BlockyPalette
    • BlockyRandomizer
    • BlockyRule
    • BlockyRuleBehaviour
    • BlockyRuleSet
    • BlockySprite
    • BlockyUtilities
    • IBlockyPiece 基础笔刷接口
    • BlockyMap
      • BlockyObjectKey 画布 单元格
      • BlockyObjectMap 画布 继承于 Dictionary