๐Ÿงฎ DT.GridSystem Unity Manual

A comprehensive guide to the DT.GridSystem โ€” a generic Unity grid framework supporting both 2D (XY) and 3D (XZ) layouts.
This manual covers architecture, usage, and function-by-function documentation with clarity.

Unity MIT License GitHub stars Made With โค๏ธ


๐Ÿ“š Table of Contents

  1. ๐Ÿ“˜ Introduction
  2. ๐Ÿงฉ Concepts & Architecture
  3. ๐Ÿ“ฆ Installation
  4. ๐Ÿ”ง How It Works
  5. ๐Ÿš€ Getting Started
  6. ๐Ÿ—๏ธ Core Classes
  7. ๐Ÿ› ๏ธ API Reference
  8. ๐Ÿงช Usage Examples
  9. ๐Ÿ’ก Best Practices
  10. โ“ FAQ
  11. ๐Ÿ“„ License

๐Ÿ“˜ Introduction

Welcome to DT.GridSystem, a flexible and extensible system for managing 2D and 3D grids in Unity.

๐Ÿง  Use Cases:
Turn-based tile games, AI navigation maps, level editors, placement systems, and more.

โœ… Features


๐Ÿงฉ Concepts & Architecture

DT.GridSystem is structured into 3 clean layers:

Layer Responsibility
Storage Holds a 2D array of TGridObject
Conversion Grid โ†” World position translation
Utilities Snapping, debug visualization, events
graph TD;
    A[GridSystem<T>] --> B[GridSystem2D<T>]
    A --> C[GridSystem3D<T>]
    B --> D[Your2DGridScript]
    C --> E[Your3DGridScript]

๐Ÿ“ฆ Installation

โœ… Option 1: Unity Package (Recommended)

  1. Open your Unity project.
  2. Go to Window โ†’ Package Manager.
  3. Click the + button โ†’ Add package from Git URLโ€ฆ
  4. Enter the URL:
https://github.com/RahulLinganagoudra/com.dreamertheory.gridsystem.git

Click Add and Unity will install the package automatically.

โ˜๏ธ Make sure your repo has a package.json in the root or under Packages/DT.GridSystem.

๐Ÿ›  Option 2: Manual Import

  1. Download or clone the repo:
git clone https://github.com/RahulLinganagoudra/com.dreamertheory.gridsystem.git

Copy the DT.GridSystem folder into your Unity projectโ€™s Assets directory.


๐Ÿ”ง How It Works

๐Ÿ—ƒ๏ธ Grid Array

TGridObject[,] gridArray = new TGridObject[width, height];

โš™๏ธ Initialization

๐Ÿ”„ Add / Remove / Get

๐ŸŒ Grid โ†” World Conversion

๐ŸŽฏ Visualization

๐Ÿ“ข Events

UnityEvent OnGridUpdated

Fired on any grid update.


๐Ÿš€ Getting Started

  1. Add DT.GridSystem to your project
  2. Inherit GridSystem2D<T> or GridSystem3D<T>
  3. Override:
protected override T CreateGridObject(GridSystem<T> grid, int x, int y)

๐Ÿ—๏ธ Core Classes

Class Purpose
GridSystem<T> Abstract base for all grids
GridSystem2D<T> 2D implementation
GridSystem3D<T> 3D implementation

๐Ÿ“„ License

MIT License โ€” Free to use, modify, and distribute.
Pull requests and attribution are welcome but not required.