D
D
Dmitry Korolev2018-07-15 10:42:18
Unity
Dmitry Korolev, 2018-07-15 10:42:18

How to set the maximum number of elements in an array?

I have an array in the inspector. I need to somehow limit its maximum length. I can't use propertydrawers because I'm already using GUILayout.
If you do not create a collection, how can you set a limit? maybe an attribute?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Korolev, 2018-12-14
@adressmoeistranici

then the array setter with the property remains in OnGUI to draw

F
freeExec, 2018-07-15
@freeExec

It cannot be limited, but you can delete unnecessary elements for each OnGUI.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question