11000+款5星资源

8.5万+用户参与评分

10万+社区成员鼎力支持

每款资源都经过 Unity 审核

首页
工具
实用工具
1/12
loading
loading
It is a property drawer you can serialize a 2D array by Array2D<T>. By using [DrawColumnMethod] Attribute, you are able to customize your own column draw method.
可编程渲染管线(SRP)兼容性
Unity可编程渲染管线(SRP)是让您能够通过C#脚本控制渲染的一个功能。SRP是支撑通用渲染管线(URP)和高清渲染管线(HDRP)的底层技术。
Unity版本内置渲染管线通用渲染管线(URP)高清渲染管线(HDRP)
6000.0.25f1
兼容
兼容
兼容
2021.3.18f1
兼容
兼容
兼容
描述

Sometimes we want to store a 2D Array for our Game development, for Level design, Procedural Dungeon etc.

However C# 2D Array T[,] is not a serializable type and if you are using a long long list for alternative it is very hard to manage a long list.

This package can help you serialize and manage a 2D Array to Inspector for your game project.


**2.x New Feature**

1. By using Attribute [DrawColumnMethod], you are now able to customize How to draw your data column. (Example is included in package and Tutorial Video)

2. By using Attribute [ColumnRatio(float)], you are now able to scale the column height by field width. (For example 1.0 mean the column will be square)


**Key Feature**

1. Serializable class Array2D<T> with 2D Array Visualizer

2. T can be everything, it is Generics type.

  • Non Generic types like int, float, string, enum, Color, Object References etc. is possible to be visualized directly.
  • Generic Type, usually is a custom Classes, will only show the Coord of data in the Table GUI. For editing, you are able to select and edit a single data, the selected object will be serialize below the "Selected Object"
  • (More Detail about Type: Unity - Scripting API: SerializedPropertyType)

3. 2D Array Resizing by width and height

4. Visualize direction, optional visualize "From Bottom To Top" or "From Top To Bottom".

5. Offset and Range is available, if you are managing a huge 2D Array, you will be able to setup an offset and range to only visualize a part of the array.


6a. If defined T is Not Generic Type, Drag and Drop Fill Mode is available for you to edit multiple columns at the same time.

6b. If defined T is a Generic Type, Select and Edit is available for you to edit custom objects one by one.


Be careful:

* Serializing a huge Array is technically possible but not recommended. One of the reasons is that serializing data will take up your disk space, so if you have a 2D Array size above 10^8 it will take a very long time to load. (You are still able to create a huge size 2D Array in code, just do not serialize that is fine)

* Array2D is a data structure, it is not equal to C# 2D Array [,]. However you are able create a Array2D from [,] by constructor Array2D([,])

技术细节

public T this[int x, int y]

  • Access the value by indexer (x, y)

public void InitSize(int width, int height)

  • Init a empty Array with width and height size

public void Resize(int width, int height)

  • Resize a 2D Array and keep its variable as possible.

It is IEnumerable so you can use foreach


using [DrawColumnMethod(string methodName)] you will able to customize your own Draw Method

[Property Drawer] Serializable 2D Array and Visualizer (Custom class supported)

(暂无评分)
2 users have favourite this asset
(2)
$5.99
席位
1
更新的价格和增值税在结算时计算
退款政策
该资源受Unity资源商店退款政策约束。有关详细信息,请参见《最终用户许可协议》(EULA)中的第2.9.3节。
安全结账方式:
Supported payment methods: Visa, Mastercard, Maestro, Paypal, Amex
许可证类型
文件大小
1.8 MB
最新版本
2.1
最新发布日期
2024年11月22日
原始 Unity 版本
2021.3.18
高品质资源
11000+款5星资源
深受用户信赖
8.5万+用户参与评分
强大的社区支持
10万+社区成员鼎力支持
Unity logo
语言
反馈
合作伙伴计划
合作伙伴
USD
EUR
Copyright © 2025 Unity Technologies
所有价格不包含税
USD
EUR
[Property Drawer] Serializable 2D Array and Visualizer (Custom class supported)
$5.99