AddWidget() public method

Make the following widget be managed by the panel.
public AddWidget ( UIWidget, w ) : void
w UIWidget,
return void
Example #1
0
    /// <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
        }
    }
Example #2
0
    /// <summary>
    /// Ensure we have a panel referencing this widget.
    /// </summary>

    public UIPanel CreatePanel()
    {
        if (mStarted && panel == null && enabled && NGUITools.GetActive(gameObject))
        {
            panel = UIPanel.Find(cachedTransform, true, cachedGameObject.layer);

            if (panel != null)
            {
                panel.AddWidget(this);
                CheckLayer();
                Invalidate(true);
            }
        }
        return(panel);
    }
Example #3
0
 public UIPanel CreatePanel()
 {
     if (mStarted && panel == null && base.enabled && NGUITools.GetActive(base.gameObject))
     {
         panel = UIPanel.Find(base.cachedTransform, /*createIfMissing:*/ true, base.cachedGameObject.layer);
         if (panel != null)
         {
             mParentFound = false;
             panel.AddWidget(this);
             CheckLayer();
             Invalidate(includeChildren: true);
         }
     }
     return(panel);
 }
Example #4
0
	static int AddWidget(IntPtr L)
	{
		try
		{
			ToLua.CheckArgsCount(L, 2);
			UIPanel obj = (UIPanel)ToLua.CheckObject<UIPanel>(L, 1);
			UIWidget arg0 = (UIWidget)ToLua.CheckObject<UIWidget>(L, 2);
			obj.AddWidget(arg0);
			return 0;
		}
		catch (Exception e)
		{
			return LuaDLL.toluaL_exception(L, e);
		}
	}
Example #5
0
    public UIPanel CreatePanel()
    {
        //if (panel == null && enabled && NGUITools.GetActive(gameObject))
        //{
        panel = UIPanel.Find(cachedTransform, true, cachedGameObject.layer);

        if (panel != null)
        {
            //mParentFound = false;
            panel.AddWidget(this);
            //CheckLayer();
            //Invalidate(true);
        }
        //}
        return(panel);
    }
Example #6
0
    /// <summary>
    /// Ensure we have a panel referencing this widget.
    /// </summary>

    void CreatePanel()
    {
        if (gameObject != null && mPanel == null && enabled && gameObject.activeSelf && gameObject.activeInHierarchy)
        {
            if (cachedTransform == null)
            {
                Debug.LogWarning("Cache Panel False");
            }

            mPanel = UIPanel.Find(cachedTransform);
            if (mPanel != null)
            {
                CheckLayer();
                mPanel.AddWidget(this);
                mChanged = true;
            }
        }
    }
Example #7
0
    /// <summary>
    /// Ensure we have a panel referencing this widget.
    /// </summary>

    public UIPanel CreatePanel()
    {
        if (mStarted && panel == null && enabled && NGUITools.GetActive(gameObject))
        {
            panel = UIPanel.Find(cachedTransform, true, cachedGameObject.layer);

            if (panel != null)
            {
                mParentFound = false;
//				if (material != null) { //add by chenbin
                panel.AddWidget(this);
//				}
                CheckLayer();
                Invalidate(true);
            }
        }
        return(panel);
    }
Example #8
0
	/// <summary>
	/// Ensure we have a panel referencing this widget.
	/// </summary>

	public void CreatePanel ()
	{
		if (mPanel == null && enabled && NGUITools.GetActive(gameObject) && material != null)
		{
			mPanel = UIPanel.Find(cachedTransform);

			if (mPanel != null)
			{
				CheckLayer();
				mPanel.AddWidget(this);
				mChanged = true;
			}
		}
	}
Example #9
0
    /// <summary>
    /// Ensure we have a panel referencing this widget.
    /// </summary>
    void CreatePanel()
    {
        if (mPanel == null && enabled && gameObject.active && material != null)
        {
            mPanel = UIPanel.Find(cachedTransform);

            if (mPanel != null)
            {
                CheckLayer();
                mPanel.AddWidget(this);
                mChanged = true;
            }
        }
    }
Example #10
0
	/// <summary>
	/// Ensure we have a panel referencing this widget.
	/// </summary>

	public UIPanel CreatePanel ()
	{
		if (mStarted && panel == null && enabled && NGUITools.GetActive(gameObject))
		{
			panel = UIPanel.Find(cachedTransform, true, cachedGameObject.layer);

			if (panel != null)
			{
				mParentFound = false;
				panel.AddWidget(this);
				CheckLayer();
				Invalidate(true);
			}
		}
		return panel;
	}