private tk2dAnimatedSprite _sprite;
private float _fadingSpeed = 0.7f;
// Update is called once per frame
void Update ()
{
StartCoroutine(fadeIn(_sprite, _fadingSpeed));
}
//Door fade in
IEnumerator fadeIn(tk2dAnimatedSprite sprite, float time)
{
float alpha = 0.0f;
while (alpha < 1.0f)
{
alpha += Time.deltaTime * time;
sprite.color = new Color(255, 255, 255, alpha);
yield return null;
}
}
I done my fading my fading like this using co routine. I hope this help.