コード例 #1
0
ファイル: NGUIWidget.cs プロジェクト: ancongsheng/vu_paradox
    /// <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;
            }
        }
    }
コード例 #2
0
ファイル: NGUIWidget.cs プロジェクト: ancongsheng/vu_paradox
    /// <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
        }
    }