Hello.
I'm trying to animate the sprite alpha using the built-in animation editor of unity 3D. I've edited the "color.a" property under "Tk 2d sliced sprite (script)" but it was not updating the alpha.
Then I've found a script, tk2d animation adapter, by googleing about the problem. Here is the script.
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class tk2dAnimationAdapter : MonoBehaviour {
public Color color = Color.white;
tk2dBaseSprite sprite = null;
// Use this for initialization
void Start() {
sprite = GetComponent<tk2dBaseSprite>();
if (sprite != null)
{
sprite.color = color;
}
}
// Update is called once per frame
void Update () {
if (sprite != null && sprite.color != color)
{
sprite.color = color;
}
}
}
When I attach this script to my objects, everything works fine. However, when I preview the animation using te animation editor wondow, since it "commits" every change, the animation editor records new keyframes to tk2d sliced sprite's color.a property.
I'm looking for a smooth solution to update the alpha via animation editor.
Thank you.