the issue happened in my game too.
here is the FIX step:
1. drag the prefab to scene view to Instantiate it
2. disable UIButton script
3. set the new values of UIButton
4. apply prefab
5. DEL the instance of prefab in scene
6. drag the prefab to scene view to Instantiate it
7. enable UIButton script
8. apply again, now the prefab is work as new values
here is the REASON of the issue, and i think it's a BUG of NGUI, instead of Unity:
*[ExecuteInEditMode]
*mNormalSprite caches in OnInit()
*SetState(State.Normal ) when OnEnable();
because OnInit will be not called again once mInitDone is set true, the old value will be cached until re-Instantiate the prefab again.
UIButton.cs
//line 116-120
get
{
+#if UNITY_EDITOR
+ if (!Application.isPlaying) mInitDone = false;
+#endif
if (!mInitDone) OnInit();
return mNormalSprite;
}
// line 215
- case State.Normal: SetSprite(mNormalSprite); break;
+ case State.Normal: SetSprite(normalSprite); break;
//line