/// <summary> /// Ensure we have a panel referencing this widget. /// </summary> public void CreatePanel() { if (mPanel == null && enabled && NGUITools.GetActive(gameObject) && material != null) { mPanel = NGUIPanel.Find(cachedTransform); if (mPanel != null) { CheckLayer(); mPanel.AddWidget(this); mChanged = true; } } }
/// <summary> /// Tell the panel responsible for the widget that something has changed and the buffers need to be rebuilt. /// </summary> public virtual void MarkAsChanged() { mChanged = true; // If we're in the editor, update the panel right away so its geometry gets updated. if (mPanel != null && enabled && NGUITools.GetActive(gameObject) && !Application.isPlaying && material != null) { mPanel.AddWidget(this); CheckLayer(); #if UNITY_EDITOR // Mark the panel as dirty so it gets updated UnityEditor.EditorUtility.SetDirty(mPanel.gameObject); #endif } }