コード例 #1
0
    void Start()
    {
        NvGameUISceneManager   mgr   = Singlton.getInstance("NvGameUISceneManager") as NvGameUISceneManager;
        NvUIDialogLayerHandler layer = mgr.findDlgLayer(layerName);

        if (layer != null)
        {
            if (DialogPrefabs != null)
            {
                foreach (GameObject obj in DialogPrefabs)
                {
                    if (obj != null)
                    {
                        NvUIDialogBase dlg = layer.createDialog(obj.name, obj);
                        if (dlg != null && dlg.name == startDlgName)
                        {
                            dlg.openDialog();
                        }
                    }
                }
            }
        }

        GameObject.Destroy(gameObject);
    }
コード例 #2
0
    public NvUIDialogLayerHandler getHandler()
    {
        if (m_handler == null)
        {
            m_handler = new NvUIDialogLayerHandler(this);
        }

        return(m_handler);
    }
コード例 #3
0
    public NvUIDialogBase CreateDialog(string dlgName)
    {
        if (mGameSceneMgr == null)
        {
            Debug.Log("NvUIDialogManager: Wait mGameSceneMgr before using this function!");
            return(null);
        }

        foreach (DialogContext ctx in mContextTable)
        {
            if (ctx.dialogPrefab == null)
            {
                continue;
            }

            if ((ctx.dialogName != "" && ctx.dialogName == dlgName) || (dlgName == ctx.dialogPrefab.name))
            {
                // spawn dialog
                NvUIDialogLayerHandler handler = mGameSceneMgr.findDlgLayer(ctx.layer.ToString(), true);

                if (handler.depth != (int)ctx.layer)
                {
                    handler.depth = (int)ctx.layer;
                }
                //Debug.Log("=======>   dlgName: "+dlgName+ "   ctx.dialogPrefab:  "+ctx.dialogPrefab);
                NvUIDialogBase dlg = handler.createDialog(dlgName, ctx.dialogPrefab);
                dlg.depth           = ctx.depth + (int)ctx.layer;
                dlg.DlgManagerOwner = this;

                // find tab
                Utility.enumWidgets(dlg.transform, findTabCallback, dlg as object);

                mDialogTable.Add(dlgName, dlg);

                return(dlg);
            }
        }
        return(null);
    }
コード例 #4
0
 protected override void AwakeImpl()
 {
     m_defaultLayer       = createDlgLayer("Default Layer");
     m_defaultLayer.depth = 0;
 }
コード例 #5
0
    public NvUIDialogLayerHandler getHandler()
    {
        if ( m_handler == null )
        {
            m_handler = new NvUIDialogLayerHandler( this );
        }

        return m_handler;
    }
コード例 #6
0
 protected override void AwakeImpl()
 {
     m_defaultLayer = createDlgLayer("Default Layer");
     m_defaultLayer.depth = 0;
 }