Ejemplo n.º 1
0
    /// <summary>
    /// Convenience method -- add a new panel.
    /// </summary>

    static public UIPanelEx AddPanel(GameObject go)
    {
        if (go == null)
        {
            return(null);
        }
        int       depth = UIPanelEx.nextUnusedDepth;
        UIPanelEx panel = NGUITools.AddChild <UIPanelEx>(go);

        panel.depth = depth;
        return(panel);
    }
Ejemplo n.º 2
0
    void Start()
    {
        if (panel == null)
        {
            panel = this.GetComponentInParent <UIPanelEx>();
        }
        if (panel == null)
        {
//			UIPanel p = this.GetComponentInParent<UIPanel>();
//			GameObject obj = p.gameObject;
//			Destroy(p);
//			panel = obj.AddComponent<UIPanelEx>();
            Debug.LogError("使用该脚本,需要有UIPanelEx的父对象");
        }
        else
        {
            panel.addUISort(this);
        }
    }
Ejemplo n.º 3
0
    void LateUpdate()
    {
        //	base.LateUpdate();

        // Update all draw calls, making them draw in the right order
        for (int i = 0, imax = list.Count; i < imax; ++i)
        {
            //UIPanel p = list[i];
            //if(p.GetType())
            //{
            UIPanelEx p = list[i] as UIPanelEx;
            if (p)
            {
                p.updateUISort();
            }
            //	Debug.Log("updateUISort:"+p.GetType());
            //}
        }
    }
Ejemplo n.º 4
0
    static void AddPanel()
    {
        UIPanelEx panel = NGUISettingsEx.AddPanel(NGUIMenu.SelectedRoot());

        Selection.activeGameObject = (panel == null) ? NGUIEditorTools.SelectedRoot(true) : panel.gameObject;
    }
Ejemplo n.º 5
0
 public void initPanel(UIPanelEx p)
 {
     panel = p;
 }