Ejemplo n.º 1
0
    /**
     * 初始化view父级
     */
    private void inintViewParent(int key, IBaseView view)
    {
        Canvas can = null;

        if (this._viewParent.TryGetValue(key, out can))
        {
            if (can != null && view is BaseEuiView)
            {
                view.addToParent();
            }
        }
        else
        {
            this._viewParent.Add(key, ((view as BaseEuiView).myParent));
            view.addToParent();
        }
    }
Ejemplo n.º 2
0
 private void setViewOpen(IBaseView view, params object[] param)
 {
     if (!view.isInit())
     {
         view.initUI();
     }
     view.initData();
     view.addToParent();
     view.setVisible(true);
     view.open(param);
 }
Ejemplo n.º 3
0
    /**
     * 开启面板
     * @param key 面板唯一标识
     * @param param 参数
     *
     */
    public IBaseView open(int key, params object[] param)
    {
        IBaseView view = this.getView(key);

        if (view == null)
        {
            return(null);
        }

        if (view.isShow())
        {
            view.open(view, param);
            view.setViewTop();
            return(view);
        }

        if (view.isInit())
        {
            view.addToParent();
            view.open(view, param);
        }
        else
        {
            GuiConfig config = GuiConfig.GetConfig(key);
            if (config == null)
            {
                return(null);
            }
            else
            {
                this.setViewOpen(view, param, key);
            }
        }

        this.openUIPlaySound(key);
        this._opens.Add(key);
        this.setOpenDepth();
        view.setViewTop();
        return(view);
    }