Ejemplo n.º 1
0
    //private NvTutorial mTutorial;

//	private bool buildVisibleTableCallback( Transform tr, object args )
//	{
//		NvUIBase elem = tr.GetComponent<NvUIBase>();
//		if ( elem == null )
//		{
//			saveVisibleToTable( tr, tr.gameObject.active );
//		}
//		else
//		{
//			return true;
//		}
//
//		return false;
//	}

    protected override void AwakeImpl()
    {
        base.AwakeImpl();

        if (dialogOwner != null)
        {
            dialogOwner.registerNotifiactionListener(gameObject);
        }

        //enumWidgets(buildVisibleTableCallback);

        if (m_tabContexts != null && m_tabContexts.Length > 0)
        {
            m_tabPages = new NvUITabPage[m_tabContexts.Length];
            int ii = 0;
            foreach (TabContext ctx in m_tabContexts)
            {
                m_tabPages[ii] = new NvUITabPage(this);
                m_tabPages[ii].m_dialogPrefab = ctx.dialogPrefab;
                m_tabPages[ii].m_dialogDepth  = ctx.dialogDepth;
                m_tabPages[ii].m_dialogOwner  = dialogOwner;
                if (ctx.tabButton != null)
                {
                    ctx.tabButton.index         = ii;
                    ctx.tabButton.eventOnClick += OnTabClicked;
                }
                ++ii;
            }
        }

        //mTutorial = NvTutorialManager.getInstance().CurrentTutorial;
    }
Ejemplo n.º 2
0
    private void OnTabClicked(object sender, object context)
    {
        int  index      = (int)context;
        bool bTabOpened = false;

        for (int ii = 0; ii < m_tabPages.Length; ++ii)
        {
            NvUITabPage page = m_tabPages[ii];
            if (ii == index)
            {
                if (page.isOpened == false && page.isCreatable)
                {
                    //page.open();
                    bTabOpened = true;
                }

                if (m_tabContexts[ii].tabButton is NvUICheckbox)
                {
                    NvUICheckbox chkbox = m_tabContexts[ii].tabButton as NvUICheckbox;
                    chkbox.setChecked(true);
                }

                break;
            }
        }

        for (int ii = 0; ii < m_tabPages.Length; ++ii)
        {
            NvUITabPage page = m_tabPages[ii];
            if (ii != index)
            {
                if (page.isOpened && bTabOpened)
                {
                    mTabsNeedToBeClosed.Add(page);
                }

                if (m_tabContexts[ii].tabButton is NvUICheckbox)
                {
                    NvUICheckbox chkbox = m_tabContexts[ii].tabButton as NvUICheckbox;
                    chkbox.setChecked(false);
                }
            }
        }

        if (index >= 0)
        {
            m_tabPages[index].open();
        }

        //mTutorial.TutorialChkTabButton ( index );
    }
Ejemplo n.º 3
0
    //private NvTutorial mTutorial;
    //    private bool buildVisibleTableCallback( Transform tr, object args )
    //    {
    //        NvUIBase elem = tr.GetComponent<NvUIBase>();
    //        if ( elem == null )
    //        {
    //            saveVisibleToTable( tr, tr.gameObject.active );
    //        }
    //        else
    //        {
    //            return true;
    //        }
    //        
    //        return false;
    //    }
    protected override void AwakeImpl()
    {
        base.AwakeImpl();

        if ( dialogOwner != null )
        {
            dialogOwner.registerNotifiactionListener(gameObject);
        }

        //enumWidgets(buildVisibleTableCallback);

        if ( m_tabContexts != null && m_tabContexts.Length > 0 )
        {
            m_tabPages = new NvUITabPage[ m_tabContexts.Length ];
            int ii = 0;
            foreach ( TabContext ctx in m_tabContexts )
            {
                m_tabPages[ii] = new NvUITabPage( this );
                m_tabPages[ii].m_dialogPrefab = ctx.dialogPrefab;
                m_tabPages[ii].m_dialogDepth = ctx.dialogDepth;
                m_tabPages[ii].m_dialogOwner = dialogOwner;
                if ( ctx.tabButton != null )
                {
                    ctx.tabButton.index = ii;
                    ctx.tabButton.eventOnClick += OnTabClicked;
                }
                ++ii;
            }
        }

        //mTutorial = NvTutorialManager.getInstance().CurrentTutorial;
    }