Example #1
0
    public void OpenPanel_CardList()
    {
        string panelName = "Panel_CardList";

        if (windowList.ContainsKey(panelName))
        {
            if (windowList[panelName])
            {
                Debuger.LogError("打开已有界面 Panel_CardList  需要更新");
            }
            else
            {
                Debuger.LogError("正在打开。请稍后");
            }
        }
        else
        {
            windowList.Add(panelName, null);
            StartCoroutine(GTUIManager.Instance().AddUiToCanvas("panel_cardlist.unity3d", panelName, true, true, (GameObject obj) =>
            {
                Panel_CardList panel = obj.AddComponent <Panel_CardList>();
                panel.name           = panelName;
                if (windowList[panelName])
                {
                    windowList[panelName].CloseUI();
                }
                windowList[panelName] = panel;
            }));
        }

//        StartCoroutine(AddmainUIToSence());
    }
Example #2
0
 /// <summary>
 /// 关闭当前场景;
 /// </summary>
 void CloseCurSence()
 {
     if (curSence != null)
     {
         curSence.CloseUI();
         GTUIManager.Instance().ClearCurSenceAssetBundle();
     }
 }
Example #3
0
 public static GTUIManager Instance()
 {
     if (_instance == null)
     {
         m_gameObject = new GameObject("GTUIManager");
         _instance    = m_gameObject.AddComponent <GTUIManager>();
         DontDestroyOnLoad(m_gameObject);
     }
     return(_instance);
 }
Example #4
0
 public static GTWindowManage Instance()
 {
     if (null == _instance)
     {
         Transform MangerBase = GTUIManager.Instance().GetManagerBaseRoot();
         m_gameObject = new GameObject("GTWindowManage");
         m_gameObject.transform.parent = MangerBase;
         _instance = m_gameObject.AddComponent <GTWindowManage>();
     }
     return(_instance);
 }
Example #5
0
    public static GTSenceManage Instance()
    {
        if (_instance == null)
        {
            Transform MangerBase = GTUIManager.Instance().GetManagerBaseRoot();
            m_gameObject = new GameObject("GTSenceManage");
            m_gameObject.transform.parent = MangerBase;
            _instance = m_gameObject.AddComponent <GTSenceManage>();
//			DontDestroyOnLoad (m_gameObject);
        }
        return(_instance);
    }
Example #6
0
 public IEnumerator AddStartSence()
 {
     yield return(StartCoroutine(GTUIManager.Instance().AddUiToCanvas("uistartgame.unity3d", "UIStartGame", true, false, (GameObject obj) =>
     {
         LaunchUI sence = obj.AddComponent <LaunchUI>();
         curSence = sence;
         if (loadingSence != null)
         {
             loadingSence.CloseUI();
         }
     })));
 }
Example #7
0
    public void FirstStartGame()
    {
        Debuger.EnableLog = true;

//		GameDataCenter.Instance ().GetCacthDataToSet ();
//		HttpController.Instance ();
        GTUIManager.Instance();
        ModelManager.Instance().InitAllModel();
//		GTUIManager.Instance().InitUIBase ();
//
//		GameDataCenter.Instance ().GetCacthDataToSet ();
    }
Example #8
0
    /// <summary>
    /// Starts the open main user interface sence.
    /// 直接加载主场景到界面上;
    /// </summary>
    void StartOpenMainUISence()
    {
        curSenceType = UISenceType.mainUISence;

        StartCoroutine(GTUIManager.Instance().AddUiToCanvas("uimain.unity3d", "uimain", true, true, (GameObject obj) =>
        {
            MainUI sence = obj.AddComponent <MainUI>();

            CloseCurSence();
            if (loadingSence != null)
            {
                loadingSence.CloseUI();
            }
            curSence = sence;
        }));
//        StartCoroutine(AddmainUIToSence());
    }
Example #9
0
    /// <summary>
    /// Gotos the logon sence.
    /// 进入登录场景;
    /// </summary>
    public void GotoLogonSence()
    {
        curSenceType = UISenceType.logonUISence;


        StartCoroutine(GTUIManager.Instance().AddUiToCanvas("uilogin.unity3d", "UILogin", true, false, (GameObject obj) =>
        {
            CloseCurSence();
            LoginUI sence = obj.AddComponent <LoginUI>();
            curSence      = sence;
            if (loadingSence != null)
            {
                loadingSence.CloseUI();
            }
        }));

//        StartCoroutine(AddLoginUIToSence());
    }
Example #10
0
    /// <summary>
    /// 添加场景内大loaidng 执行逻辑;
    ///
    /// </summary>
    /// <param name="isRemoveCurSence">loading 添加好之后是否删掉当前场景</param>
    /// <param name="endCall"></param>
    /// <param name="addCall"></param>
    /// <param name="args"></param>
    /// <typeparam name="T"></typeparam>
    public void AddLoadingUIToSence <T>(bool isRemoveCurSence, PreCtrlBase.EndLoading endCall, PreCtrlBase.EndAddLoadingUI addCall,
                                        params object[] args) where T : PreCtrlBase
    {
//        StartCoroutine(AddLoadingUI<T>(endCall, addCall, args));
        if (loadingSence != null)
        {
            if (isRemoveCurSence)
            {
                CloseCurSence();
            }
            T precCtrl = loadingSence.gameObject.AddComponent <T>();
            precCtrl.loadingUICS = (LoadingUI)loadingSence;
            precCtrl.EndLoadCall = endCall;
            precCtrl.StarLoadData(args);
            if (addCall != null)
            {
                addCall(precCtrl);
            }
        }
        else
        {
            StartCoroutine(GTUIManager.Instance().AddUiToCanvas("uiloading.unity3d", "uiloading", true, false, (GameObject obj) =>
            {
                if (isRemoveCurSence)
                {
                    CloseCurSence();
                }
                LoadingUI diaSrc = obj.AddComponent <LoadingUI>();

                T precCtrl           = obj.AddComponent <T>();
                precCtrl.loadingUICS = diaSrc;
                precCtrl.EndLoadCall = endCall;
                precCtrl.StarLoadData(args);
                loadingSence = diaSrc;
                if (addCall != null)
                {
                    addCall(precCtrl);
                }
            }));
        }
//
    }
Example #11
0
    IEnumerator LoadMainiFast()
    {
        Debug.LogError("----zys----  start load mainfalst");
        yield return(StartCoroutine(Initialize()));

        Debug.LogError("----zys----  back to laod");

        yield return(StartCoroutine(LoadRootUI()));

        yield return(StartCoroutine(LoadRootUI1()));

        AssetBundleManager.UnloadAssetBundle("baseui.unity3d");
        AssetBundleManager.UnloadAssetBundle("baseui.unity3d");

        GTUIManager.Instance().SetInitRootUI(staticCanvas, effCanvas);
        yield return(StartCoroutine(LoadLoadingUI()));

        yield return(StartCoroutine(GTSenceManage.Instance().AddStartSence()));

//        yield return StartCoroutine(LoadStartSenceUI());
    }