-
Notifications
You must be signed in to change notification settings - Fork 11
Tile Systems
A tile system is a grid which allows you to effortlessly paint both 2D and 3D tiles alongside one another using brushes. Tiles are automatically aligned and oriented to their tile system upon being painted.
Tiles can be painted using the provided tools or by custom runtime or editor scripts. Such scripts typically interact with tile system components and brush assets allowing you to procedurally generate maps or even implement your very own in-game level designer!
Each tile system is a game object with the the TileSystem
component attached. With the
exception of tiles that are painted using purely procedural brushes, each tile is an
individual game object. Data is stored on a per tile basis which can be accessed using the
runtime API or stripped from builds when not needed at runtime (see Stripping).
-
Chunks
Tiles are mapped using a chunked data structure which helps to avoid memory wastage when large areas of a tile system remain empty. Custom scripts can access tile data transparently of the underlying data structure. -
Creating a Tile System
The tile system creation interface can be accessed via the main tool menu allowing you to define the specifics for your tile system. You can later modify your tile system using the inspector if desired. -
Position, Rotate and Scale
A tile system can be selected using the scene palette or hierarchy window or by clicking its handle in scene view. Selected tile system can then be transformed using the regular move, rotate and scale tools provided by Unity. -
Using the Tile System Inspector
A specialized inspector is provided allowing you to modify and configure tile systems after they have been created. Multiple tile systems can be inspected at the same time. -
Changing Cell Size
You can change the width, height and depth of tile cells in an existing tile system using the inspector interface. -
Repairing a Tile System
Tiles become broken when their data remains yet their game object counterpart is missing. A common cause of this is where tile game objects are deleted instead of being erased. -
Clearing a Tile System
Tiles and chunks can be cleared from a tile system using the tile system inspector or via the context menu in the scene palette. -
Tile System Optimization
Various options are provided allowing you to strip unwanted aspects from the tile systems in your projects. You can also combine tile meshes by material on a per chunk basis to reduce the number of draw calls which can be particularly beneficial when targeting mobile platforms.
Source: topics/Tile-Systems.md
Copyright © Rotorz Limited. All rights reserved.