- Home /
Animation Editor not seeing (all) the properties of my component
I have implemented a laser script for my 2d game which can (with the help of the animation editor) move around like lasers in nightclubs for example. I've also done a class for each beam so that you can modify properties of every single beam.
However the animation editor only can see spot angle and start angle. I can't see the beams because it seems like it can't deal with arrays and lists.
I could turn the beam class into a MonoBehaviour class and add a child gameobject for each beam to the laser, but it would make the editing of each beam very complicated. I want to keep the inspector layout of editing the beams like in the picture because it's very nice to handle.
If you click on the buttons above, every beam copies the value from beam 0. For example if you click on the Color button, all beams get the color of beam 0. Which makes editing very handy because in most of the case the beams should be the same. The enabled property can be used to do some cool effects too.
The implementation works but I can't make it work with unitys animation editor, is there way to make it work and - if possible - to keep the inspector layout?
The most quickly and by far the most dirty solution is to apply a fixed number of beams and having fields from Color1 to Color10 in the code (c#) but that's very stupid imo. I also haven't been working with the animation editor so long.