Change the Element Name of Arrays in Unity

Фильм және анимация

How to change the Element name in Array Classes in the Unity Inspector to a more useful and descriptive term.

Пікірлер: 11

  • @xtexasredx6051
    @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
    @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
    @danilocedeno9765 Жыл бұрын

    Quick and easy. Brilliant tutorial, thank you.

  • @neolithicVrGame
    @neolithicVrGame Жыл бұрын

    Thanks for this! I knew there was a lazy way to do this but forgot it needed to be the first variable! 😂

  • @confusedsnail6457
    @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

  • @angeldiaz7554
    @angeldiaz75545 жыл бұрын

    Ty this helped me!

  • @briangular2115
    @briangular2115 Жыл бұрын

    you are awesome, thank you man

  • @BR14Nx
    @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.

  • @kyanrowse4150
    @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

    @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

  • @dediiswadi7793
    @dediiswadi77934 жыл бұрын

    Hi, I think we need this code public MyStruct[] structArray; [System.Serializable] public struct MyStruct { public string title; public int number; }

Келесі