Use 2-dimensional arrays in Unity's Inspector.
Use this if you want to deal with 2D arrays easily within the inspector of Unity.
For a quick import into an existing project, just get the UnityPackage. It also contains some examples.
The Array2DEditor
folder on this repo is an empty project with only the plugin imported! 🙂
To get started:
Array2DEditor
, such as Array2DInt
, Array2DBool
, Array2DString
...using Array2DEditor
on top of your script.GetCells()
or GetCell(int x, int y)
on your variable to get the values from your array at runtime!
To do that:
CellRow<T>
with your own type as the T
type.
CellRowTypes
as an example.Array2D<T>
with your own type as the T
type.
Array2D<T>
classes that you can find in the Array2DTypes
folder as an example.Array2DDrawer
and put it in an Editor
folder.
Array2DDrawer
classes that you can find in the Editor/PropertyDrawers
folder as an example.PropertyDrawer
inherit directly from Array2DEnumDrawer
. The code will then be trivial.
Array2DExampleEnumDrawer
as an example.Array2DEditor
.Array2DEditor
.This project is licensed under the MIT License - see the LICENSE.md file for details