How to change the Element name in Array Classes in the Unity Inspector to a more useful and descriptive term.
Жүктеу.....
Пікірлер: 11
@xtexasredx60519 ай бұрын
Thanks man, I remembered there was a way of doing this but could not for the life of me remember how. Quick and straight to the point :D
@Gabahulk Жыл бұрын
It's not cool that we have to do this hack to achieve this, but the fact that you find this out is briliant! Thanks for the tip!
@danilocedeno9765 Жыл бұрын
Quick and easy. Brilliant tutorial, thank you.
@neolithicVrGame Жыл бұрын
Thanks for this! I knew there was a lazy way to do this but forgot it needed to be the first variable! 😂
@confusedsnail6457 Жыл бұрын
how would I get the variables from each of these categories in a script now though? I keep getting an error saying that the array can't be converted to an int
@angeldiaz75545 жыл бұрын
Ty this helped me!
@briangular2115 Жыл бұрын
you are awesome, thank you man
@BR14Nx Жыл бұрын
Is it possible to set the elements name automatically with another variable? E.g. by adding a gameobject in the according field and the element will show the gameobjects name.
@kyanrowse41503 жыл бұрын
How do I do this with monobehavior? I have an array of floats and I want to change the element names in the inspector.
@MarkSweeney
3 жыл бұрын
You can create a class in your script with the same elements as your array, plus the string variable at the top, then create a new array of that class. Create a method that copies your array to the new class array, and execute it in the inspector using a docs.unity3d.com/ScriptReference/ContextMenuItemAttribute.html
@dediiswadi77934 жыл бұрын
Hi, I think we need this code public MyStruct[] structArray; [System.Serializable] public struct MyStruct { public string title; public int number; }
Пікірлер: 11
Thanks man, I remembered there was a way of doing this but could not for the life of me remember how. Quick and straight to the point :D
It's not cool that we have to do this hack to achieve this, but the fact that you find this out is briliant! Thanks for the tip!
Quick and easy. Brilliant tutorial, thank you.
Thanks for this! I knew there was a lazy way to do this but forgot it needed to be the first variable! 😂
how would I get the variables from each of these categories in a script now though? I keep getting an error saying that the array can't be converted to an int
Ty this helped me!
you are awesome, thank you man
Is it possible to set the elements name automatically with another variable? E.g. by adding a gameobject in the according field and the element will show the gameobjects name.
How do I do this with monobehavior? I have an array of floats and I want to change the element names in the inspector.
@MarkSweeney
3 жыл бұрын
You can create a class in your script with the same elements as your array, plus the string variable at the top, then create a new array of that class. Create a method that copies your array to the new class array, and execute it in the inspector using a docs.unity3d.com/ScriptReference/ContextMenuItemAttribute.html
Hi, I think we need this code public MyStruct[] structArray; [System.Serializable] public struct MyStruct { public string title; public int number; }