Search Unity

Customize Animation Editor or Inspector Title

Discussion in 'Editor & General Support' started by devel, Jan 27, 2010.

  1. devel

    devel

    Joined:
    Mar 11, 2009
    Posts:
    140
    Hi,

    I would like to have a float[] array whose values can be changed for animation in the animation editor.
    Now I know that the content of my array is not shown in the animation editor.

    Is there a method so I can force values to be shown in the AnimationEditor?

    Now i tried a work around so instead of a float[] array i am using a list of components (named MyComponent)with a public float field.

    Now the animation editor has a list of MyComponents for which i can change float values. In order to know which component i am changing i would like to change the name (shown as inspector title and component name in the animation editor) to lets say MyComponent A, MyComponent B, etc..
    Can I do this? If so how?

    Thanks
     
  2. devel

    devel

    Joined:
    Mar 11, 2009
    Posts:
    140
    I worked with IDs now so I could see in the Animation Editor which component i am working on. Turns out the animation editor shows only the first component multiple times (if the game object has 5 MyComponent scripts attached the settings of the first one are shown 5 times).

    This sucks.

    Is there any other possibility, trick, workaround to animate an array of floats?
     
  3. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    You can add as many separate public properties to a script as you like, but arrays and serialisable classes will not be shown in the animation editor like they are in the inspector. If you are using C# and you need the array mainly for coding purposes, perhaps you could define an indexer for the class that gets the properties in order of the index number. (Not ideal, I know.)
     
  4. devel

    devel

    Joined:
    Mar 11, 2009
    Posts:
    140
    Hi andeeee,

    thank you for answering. I am using seperate variables now. I wish there was a method to add a variable to the animation editor, would make things much easier.
    But for now I made friends with it. And I can still put those seperate variables to a float array and pretend they were dynamic :).

    Thanks.