When i am changing it on mouse click its changing and instantly going back to previous sprite.
this is the code i am using.
public void Local()
{
localButtons.GetComponent<UISprite>().spriteName = "local_inner_shadow";
cloudButtons.GetComponent<UISprite>().spriteName = "cloud";
}
i also tried like this
public void Local()
{
UISprite sprite1 = localButtons.GetComponent<UISprite>();
sprite1.spriteName = "local_inner_shadow";
UISprite sprite2 = cloudButtons.GetComponent<UISprite>();
sprite2.spriteName = "cloud";
}
but same problem is there.