Coder Social home page Coder Social logo

blocky-world-editor's Introduction

BlockyWorldEditor

Code from "Creating a 3D Tilemap Editor and World Builder in Unity" YouTube videos

###Quick Start Video

Installation

Requires Unity 2021.2+ Can be installed via the Package Manager > Add Package From Git URL... https://github.com/peartreegames/blocky-world-editor.git

Overview

The BlockyWorldEditor allows you to quickly place GameObjects into your scenes on a 1x1x1 unit grid. (Size is potentially modifiable and something which could be added to this package.)

To start click Tools > BlockyEditor

Architectural Overview

Architecture

Palettes

Create > Blocky > Palette

A collection of IBlockyPieces to place in your scene. Will automatically be added to the dropdown selection.

Layers

Create > Blocky > Layer

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.

BlockyObject

MonoBehaviour to be added to GameObjects you wish you place.

BlockyRuleSet

Collection of BlockyObjects which change based on their neighbours. Good for paths, fences, walls, etc.

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.

BlockyParentSetter

To create your own ParentSetter create a new class derived from the BlockyParentSetter, which will return a Transform. This allows you to place your objects however you wish. See the BlockyWorldStreamer for an example.

IBlockyScenePreprocessor

When finishing painting it's convenient (and advised) to process a scene for optimizations or data collection. Any class which implements this interface will be called for all opened scenes when the mode changes.

void ProcessScene(BlockyEditorWindow window, Scene scene);
void RevertScene(BlockyEditorWindow window, Scene scene);

Hotkeys

Key Description
W/S Grid Height
Shift Box drag
Ctrl Remove
Q/E Rotate 90 degress
R Random Rotation
1-4 Brush Size
+/- Increase/Decrease Brush Size

Notes

BlockyObjects have a "allowRandomRotation" flag, when using RandomRotation in the editor only those set will be rotated, otherwise will be set to the current rotation (or BlockyParentSetter's rotation).

Todo

  • Implement random rotation
  • Implement placement visualization
  • Better refresh (editor/palettes) on changes

blocky-world-editor's People

Contributors

bgk- avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.