public override Texture2D getTexture()
{
if (!compilable) {
if (still_icon == null || !still_icon.ToString().Contains("UncastableScroll")) {
still_icon = Resources.Load("Textures/UncastableScroll") as Texture2D;
}
return still_icon;
}
if(still_icon == null || still_icon.ToString().Contains("UncastableScroll"))
still_icon = Resources.Load("Textures/Scroll") as Texture2D;
if(animated_icon == null)
{
animated_icon = new Texture2D[3];
animated_icon[0] = Resources.Load("SparkleScroll1") as Texture2D;
animated_icon[1] = Resources.Load("SparkleScroll2") as Texture2D;
animated_icon[2] = Resources.Load("SparkleScroll3") as Texture2D;
}
if(animate)
{
current_frame = (current_frame + 1) % 30;
return animated_icon[(current_frame / 10)];
} else {
return still_icon;
}
}