1
Support / Re: Sliced sprite
« on: August 12, 2015, 07:14:12 pm »
Can this be done only with 2DToolkit?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
public int speed = 4;
bool isFadeIn = false;
bool isFadeOut = false;
float alphaColor = 0;
Color spriteColor;
void Update()
{
if(isFadeIn == true && alphaColor < 255)
{
alphaColor += Time.deltaTime * speed;
spriteColor.a = alphaColor;
GetComponent<tk2dSprite>().color= spriteColor;
}
}
public void FadeIn()
{
isFadeIn = true;
}
public void FadeOut()
{
isFadeOut = true;
}