Details
Simple, Scriptable Object based grid creator for puzzle games
I am gonna explain how to create a grid in later parts. But, if you want to have an earlier look, go ahead "Window/SimpleGrid/Create Grid" to see what a grid looks like.
- SimpleGrid consists of two grid types: Quadral and Hexagonal
- Each type has its own settings
- Initial Pos: World Pos where the grid is gonna start to shape into
- Grid Prefab: The object that each grid will represent
- Width: The width of the grid
- Height: The height of the grid
- Width Offset: The width offset of the grid
- Height Offset: The height offset of the grid
1 - Quadral Settings
1 - Hexagonal Settings
- Hexagonal Offset: The hexagonal offset between grid objects
create-a-grid.mp4
- SimpleGrid creates individual objects in the given order and stores them inside a list of cells. Cell is basically a Serializable C# class.
- You can access SimpleGrid's data like below.
using UnityEngine;
public class LevelManager : MonoBehaviour
{
public BaseGridSettings gridSettings;
private void Start()
{
gridSettings.Create();
Debug.Log("First Cell is at: " + gridSettings.Cells[0].worldPos);
}
}