Well, this might be an incredibly simple thing and I can work around it with scripting, however, I’d like to animate script properties with the animator. I write in JS and my properties aren’t available in the animation window. The only property that’s available is ‘enabled.’
Some imported scripts in C# have properties available in the animation window, but as I said, I usually use JavaScript. If need be, there’s really not an issue converting everything to C# except for the time aspect.
Of course, as I always do, I scoured the internet for clues and, as usual, I’ll probably fix the problem before anyone answers
I’ll just show what I’m using just to test it:
#pragma strict
var GlitchProbability : int;
function Update () {
if (GetComponent(GUITexture)) GUIGlitch();
if (SpriteRenderer) SpriteGlitch();
}
function GUIGlitch () {
if (Random.Range(0, GlitchProbability) == 1) GetComponent(GUITexture).enabled = !GetComponent(GUITexture).enabled;
}
function SpriteGlitch () {
if (Random.Range(0, GlitchProbability) == 1) GetComponent(SpriteRenderer).enabled = !GetComponent(SpriteRenderer).enabled;
}