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); }
public NvUIDialogLayerHandler getHandler() { if (m_handler == null) { m_handler = new NvUIDialogLayerHandler(this); } return(m_handler); }
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); }
protected override void AwakeImpl() { m_defaultLayer = createDlgLayer("Default Layer"); m_defaultLayer.depth = 0; }
public NvUIDialogLayerHandler getHandler() { if ( m_handler == null ) { m_handler = new NvUIDialogLayerHandler( this ); } return m_handler; }
protected override void AwakeImpl() { m_defaultLayer = createDlgLayer("Default Layer"); m_defaultLayer.depth = 0; }