Exemplo n.º 1
0
    void UpdateRight()
    {
        UIASSETS_ID uiId = GlobalValue.GetMoreActivityID(crtType_);

        if (uiId != (UIASSETS_ID)0)
        {
            loadingSub_ = true;
            UIAssetMgr.LoadUI(uiId, (AssetBundle Asset, ParamData Param) =>
            {
                if (rightContent_ == null)
                {
                    UIAssetMgr.DeleteAsset(uiId, true);
                    return;
                }

                GameObject subUi = (GameObject)GameObject.Instantiate(Asset.mainAsset) as GameObject;
                Asset.Unload(false);
                subUi.transform.parent        = rightContent_;
                subUi.transform.localScale    = Vector3.one;
                subUi.transform.localPosition = Vector3.zero;
                UIManager.Instance.AdjustUIDepth(subUi.transform, false);
                loadingSub_ = false;
            }, null);
        }
    }
Exemplo n.º 2
0
    public override void Destroyobj()
    {
        hasDestroy = true;
        if (BagUI.Instance != null)
        {
            if (BagUI.Instance.GetRole() != null)
            {
                BagUI.Instance.GetRole().SetActive(true);
            }
        }
        if (GamePlayer.Instance.babies_list_.Count != 0)
        {
            if (MainbabyUI.Instance != null)
            {
                if (MainbabyUI.Instance.isState)
                {
                    if (MainbabyListUI.babyObj != null)
                    {
                        MainbabyListUI.babyObj.SetActive(true);
                    }
                }
            }
        }
        UIAssetMgr.DeleteAsset(openedBabyBank, true);
        BankSystem.instance.isopen = false;
//		if (roleObj != null)
//			roleObj.SetActive (true);
    }
Exemplo n.º 3
0
    public void CloseUI(UIASSETS_ID assetID, bool unLoadAllLoadedObjects)
    {
        UIBase ba = null;

        if (mainPanelObj != null && mType == menuTypes.MAIN)
        {
            ba = mainPanelObj.GetComponent <UIBase> ();
        }
        else
        {
            //ba = popPanelObj.GetComponent<UIBase> ();
        }

        if (ba != null)
        {
            ba.Destroyobj();
            //GlobalInstanceFunction.Instance.ReleaseTexture(ba.transform);
        }
        else
        {
            if (mainPanelObj != null && mType == menuTypes.MAIN)
            {
                //GlobalInstanceFunction.Instance.ReleaseTexture(mainPanelObj.transform);
                Destroy(mainPanelObj);
            }
            else
            {
                //ReleaseTexture(popPanelObj.transform);
                //Destroy(popPanelObj);
            }
        }
        UIAssetMgr.DeleteAsset(assetID, unLoadAllLoadedObjects);
    }
Exemplo n.º 4
0
 public void InitArrow()
 {
     UIAssetMgr.LoadUI("jiantou", (AssetBundle bundle, ParamData data) =>
     {
         pointerPrefab_ = bundle.mainAsset;
     }, null);
 }
Exemplo n.º 5
0
    public void ParseDataFinish()
    {
        TransferRate._Inst.Send("Load Config End");
        // init some system which based on config table.
        ActivitySystem.Instance.Init();
        SceneLoader.Instance.Init();

        //这个界面为ui打开前的loading 需要快速加载 所以预先加载到内存
        UIAssetMgr.LoadUI(UIASSETS_ID.UIASSETS_UILoading, (Assets, paramData) =>
        {
            uiLoadingPanel_ = GameObject.Instantiate(Assets.mainAsset) as GameObject;
            uiLoadingPanel_.transform.parent     = uiRoot.transform;
            uiLoadingPanel_.transform.localScale = Vector3.zero;
            uiLoadingPanel_.SetActive(false);
            UIPanel panel = uiLoadingPanel_.GetComponent <UIPanel>();
            if (panel == null)
            {
                panel = uiLoadingPanel_.AddComponent <UIPanel>();
            }
            originDepth = panel.depth;
        }, null);

        //加载聊天ui
        GameManager.Instance.InitChatUI("LoginScene");
    }
Exemplo n.º 6
0
    public void InitIconCell()
    {
        if (goRes_ == null)
        {
            UIAssetMgr.LoadUI("ItemCell", (AssetBundle bundle, ParamData data) => {
                goRes_ = bundle.mainAsset;
            }, null);
        }

        if (goStateRes_ == null)
        {
            UIAssetMgr.LoadUI("StateCell", (AssetBundle bundle, ParamData data) =>
            {
                goStateRes_ = bundle.mainAsset;
            }, null);
        }

        if (goSkillRes_ == null)
        {
            UIAssetMgr.LoadUI("SkillCell", (AssetBundle bundle, ParamData data) =>
            {
                goSkillRes_ = bundle.mainAsset;
            }, null);
        }

        if (goBabyRes_ == null)
        {
            UIAssetMgr.LoadUI("BabyCell", (AssetBundle bundle, ParamData data) =>
            {
                goBabyRes_ = bundle.mainAsset;
            }, null);
        }
    }
Exemplo n.º 7
0
    private void LoadUI(UIASSETS_ID id, string sceneName)
    {
        subUiResPath = GlobalInstanceFunction.Instance.GetAssetsName((int)id, AssetLoader.EAssetType.ASSET_UI);

        UIAssetMgr.LoadUI(subUiResPath, (Assets, paramData) =>
        {
            if (null == Assets || null == Assets.mainAsset)
            {
                return;
            }
            GameObject go           = (GameObject)GameObject.Instantiate(Assets.mainAsset) as GameObject;
            go.transform.parent     = ApplicationEntry.Instance.uiRoot.transform;
            go.transform.localScale = Vector3.one;
            chatobj = go;

            if (sceneName.Equals("LoginScene") || sceneName.Equals("CreateRoleScene") || sceneName.Equals("ReturnScene") || sceneName.Equals("LoadingScene") || StageMgr.Scene_name.Equals("PalaceScene"))
            {
                chatobj.SetActive(false);
            }
            else
            {
                chatobj.SetActive(true);
            }
        }
                          , null);
    }
Exemplo n.º 8
0
 public void Init()
 {
     if (panelObj_ == null)
     {
         UIAssetMgr.LoadUI("headChatUI", (AssetBundle bundle, ParamData data) =>
         {
             panelObj_ = bundle.mainAsset;
         }, null);
     }
 }
Exemplo n.º 9
0
 public void Init()
 {
     msgQue_ = new Queue <Pkg>();
     if (popTextObj_ == null)
     {
         UIAssetMgr.LoadUI("PopText", (AssetBundle bundle, ParamData data) =>
         {
             popTextObj_ = bundle.mainAsset;
         }, null);
     }
 }
Exemplo n.º 10
0
 void Update()
 {
     if (async_ != null)
     {
         if (async_.progress >= 0.9f && CanEnter_ && LoginLoaded)
         {
             async_.allowSceneActivation = true;
         }
     }
     AssetLoader.Update();
     AtlasLoader.Instance.Update();
     UIAssetMgr.Update();
 }
Exemplo n.º 11
0
 void Update()
 {
     if (async_ != null)
     {
         if (async_.progress >= 0.9f && CanEnter_ && LoginLoaded)
         {
             async_.allowSceneActivation = true;
             TransferRate._Inst.Send("Show Jiankang Notice End");
         }
     }
     AssetLoader.Update();
     AtlasLoader.Instance.Update();
     UIAssetMgr.Update();
 }
Exemplo n.º 12
0
 public void Init()
 {
     noticeQue_    = new Queue <string>();
     vipNoticeQue_ = new Queue <string>();
     UIAssetMgr.LoadUI("Notice", (AssetBundle bundle, ParamData data) =>
     {
         GameObject noticePanel           = GameObject.Instantiate(bundle.mainAsset) as GameObject;
         noticePanel.transform.parent     = ApplicationEntry.Instance.uiRoot.transform;
         noticePanel.transform.localScale = Vector3.one;
         //GlobalInstanceFunction.Instance.Invoke(() =>
         //{
         //    bundle.Unload(false);
         //    bundle = null;
         //}, 1);
     }, null);
 }
Exemplo n.º 13
0
 public void DestroyLoadingUI()
 {
     if (destroyed)
     {
         return;
     }
     if (GameManager.Instance != null)
     {
         GameManager.Instance.SetChatUIActive(true);
     }
     if (StageMgr.Loadtype == SwitchScenEffect.LoadingBar)
     {
         //GlobalInstanceFunction.Instance.ReleaseTexture(transform);
         UIAssetMgr.DeleteAsset(UIASSETS_ID.UIASSETS_LoadingPanel, true);
         Destroy(gameObject);
         GameManager.Instance.EnableDelayCheck(true);
         HeadIconLoader.Instance.Delete(scenenicon);
     }
 }
Exemplo n.º 14
0
    private void LoadBabyUI(UIASSETS_ID id)
    {
        //subUiResPath = GlobalInstanceFunction.Instance.GetAssetsName((int)id, AssetLoader.EAssetType.ASSET_UI);

        UIAssetMgr.LoadUI(id, (Assets, paramData) =>
        {
            if (hasDestroy)
            {
                //AssetInfoMgr.Instance.DecRefCount(subUiResPath, true);
                UIAssetMgr.DeleteAsset(id, true);
                return;
            }
            if (null == Assets || null == Assets.mainAsset)
            {
                UIAssetMgr.DeleteAsset(id, true);
                return;
            }
            GameObject go = (GameObject)GameObject.Instantiate(Assets.mainAsset) as GameObject;
            if (this == null && !gameObject.activeSelf)
            {
                Destroy(go);
                return;
            }
            babyObj                    = go;
            go.transform.parent        = this.panel.transform;
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = Vector3.one;
            //UIManager.Instance.AdjustUIDepth(go.transform);
            if (babyBtn.isEnabled)
            {
                babyObj.gameObject.SetActive(false);
                return;
            }
            UIManager.Instance.AdjustUIDepth(transform);
            //AssetInfoMgr.Instance.DecRefCount(subUiResPath, false);
            openedBabyBank = id;
        }
                          , null);
    }
Exemplo n.º 15
0
    public void Hide()
    {
        // Remove from global container.

        if (_PanelShowStates.ContainsKey(_UIResPath))
        {
            //if(_PanelShowStates[_UIResPath] == UIShowCmd.Hide)
            //{
            //    return;
            //}
            _PanelShowStates[_UIResPath] = UIShowCmd.Hide;
            _PanelShown.Remove(_UIResPath);
        }
        if (_Panel == null)
        {
            return;
        }
        // 从场景移除.
        DoHide();

        AtlasLoader.Instance.DeleteAtlas(UIDepedenceData.GetRefAtlas(_UIResPath));
        UIAssetMgr.DeleteAsset(_UIResPath);
    }
Exemplo n.º 16
0
    // Update is called once per frame
    void Update()
    {
        if (Application.platform == RuntimePlatform.Android && (Input.GetKeyDown(KeyCode.Escape)))
        {
            if (game.GameUser.getInstance().isFunctionSupported("exit"))
            {
                game.GameUser.getInstance().callFuncWithParam("exit");
            }
            else
            {
                MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("ConfirmQuit"), () =>
                {
                    Application.Quit();
                }, false, null, null, "", "", 2000, true);
            }
        }

        AtlasLoader.Instance.Update();
        PlayerDepLoader.Instance.Update();
        EffectDepLoader.Instance.Update();
        AssetInfoMgr.Instance.Update();
        UIAssetMgr.Update();
        PlayerAsseMgr.Update();
        EffectAssetMgr.Update();
        SceneLoader.Instance.Update();
        GuideManager.Instance.Update();
        GlobalInstanceFunction.Instance.Update();
        EventMgr.Instance.Update();
        NetConnection.Instance.Update();
        AssetLoader.Update();
        GameManager.Instance.Update();
        Prebattle.Instance.Update();
        Battle.Instance.Update();
        EffectMgr.Instance.Update();
        VersionManager.Instance.Update();
        ChatSystem.Update();
        BagSystem.instance.UpdateUsetime();
        BabyData.UpdateUsetime();
        EmployeeTaskSystem.instance.Update();
        if ((gameHandler._SdkInitSuccess || GlobalValue.IsDebugMode) && mayPullResFolderName)
        {
            mayPullResFolderName = false;
            //跳过cdn检查
            TransferRate._Inst.Send("Load LoginPanel Begin");
//            UIFactory.Instance.LoadUIPanel("LoginPanel", () =>
//            {
            UIFactory.Instance.OpenUI(GlobalValue.StageName_LoginScene, menuTypes.MAIN);
            TransferRate._Inst.Send("Load LoginPanel End");
//                AssetLoader.LoadAssetBundle("NpcNameLabel", AssetLoader.EAssetType.ASSET_UI, (AssetBundle bundle2, ParamData data2) =>
//                {
//                    nameLabel = bundle2.mainAsset;
//                    mayShowSysNotice = true;
//                }, null, Configure.assetsPathstreaming);
//            });
            //StartCoroutine(PullResFolderName());
        }

        if ((gameHandler._SdkInitSuccess || GlobalValue.IsDebugMode) && mayShowSysNotice)
        {
            TransferRate._Inst.Send("Show System Notice");
            mayShowSysNotice = false;
            //公告时 加载点轻量级资源
            PopText.Instance.Init();
            NpcHeadChat.Instance.Init();
            StartCoroutine(SysNotice());
        }
    }
Exemplo n.º 17
0
    private void LoadUI(UIASSETS_ID id, int num)
    {
        subUiResPath = GlobalInstanceFunction.Instance.GetAssetsName((int)id, AssetLoader.EAssetType.ASSET_UI);
        if (subUIs_ == null)
        {
            subUIs_ = new List <string>();
            subUIs_.Add(subUiResPath);
        }
        else
        {
            if (!subUIs_.Contains(subUiResPath))
            {
                subUIs_.Add(subUiResPath);
            }
        }
        UIAssetMgr.LoadUI(subUiResPath, (Assets, paramData) =>
        {
            if (hasDestroy)
            {
                UIAssetMgr.DeleteAsset(subUiResPath);
                return;
            }
            if (null == Assets || null == Assets.mainAsset)
            {
                return;
            }
            GameObject go = (GameObject)GameObject.Instantiate(Assets.mainAsset) as GameObject;
            if (this == null && !gameObject.activeSelf)
            {
                Destroy(go);
            }
            go.transform.parent        = back.transform;
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = Vector3.one;
            if (num == 1)
            {
                familyConstructionObj = go;
                if (Guildbtns[num].isEnabled)
                {
                    familyConstructionObj.SetActive(false);
                }
            }
            else if (num == 2)
            {
                familyShopingObj = go;
                if (Guildbtns[num].isEnabled)
                {
                    familyShopingObj.SetActive(false);
                }
            }
            else if (num == 3)
            {
                familyZhufuObj = go;
                if (Guildbtns[num].isEnabled)
                {
                    familyZhufuObj.SetActive(false);
                }
            }
            else
            if (num == 4)
            {
                familyZhufuOHD = go;
                if (Guildbtns[num].isEnabled)
                {
                    familyZhufuOHD.SetActive(false);
                }
            }
            if (num == 5)
            {
                familyMessageObj = go;
                if (Guildbtns[num].isEnabled)
                {
                    familyMessageObj.SetActive(false);
                }
            }


            UIManager.Instance.AdjustUIDepth(go.transform);
            NetWaitUI.HideMe();
            UIManager.Instance.AdjustUIDepth(go.transform);
        }
                          , null);
    }
Exemplo n.º 18
0
    // Update is called once per frame
    void Update()
    {
        if (Application.platform == RuntimePlatform.Android && (Input.GetKeyDown(KeyCode.Escape)))
        {
            MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("ConfirmQuit"), () =>
            {
                SDKInterface.Instance.SDKExit();
                //Application.Quit();
            }, false, null, null, "", "", 2000, true);
        }

        AtlasLoader.Instance.Update();
        PlayerDepLoader.Instance.Update();
        EffectDepLoader.Instance.Update();
        AssetInfoMgr.Instance.Update();
        UIAssetMgr.Update();
        PlayerAsseMgr.Update();
        EffectAssetMgr.Update();
        SceneLoader.Instance.Update();
        GuideManager.Instance.Update();
        GlobalInstanceFunction.Instance.Update();
        EventMgr.Instance.Update();
        NetConnection.Instance.Update();
        AssetLoader.Update();
        GameManager.Instance.Update();
        Prebattle.Instance.Update();
        Battle.Instance.Update();
        EffectMgr.Instance.Update();
        VersionManager.Instance.Update();
        ChatSystem.Update();
        BagSystem.instance.UpdateUsetime();
        BabyData.UpdateUsetime();
        EmployeeTaskSystem.instance.Update();

        if (mayShowSysNotice)
        {
            mayShowSysNotice = false;
            //公告时 加载点轻量级资源
            PopText.Instance.Init();
            NpcHeadChat.Instance.Init();
            StartCoroutine(SysNotice());
        }


        //PopText.Instance.Init();
        //NpcHeadChat.Instance.Init();
        //StartCoroutine(SysNotice());


        if (mayPullResFolderName)
        {
            mayPullResFolderName = false;
            //跳过cdn检查
            UIFactory.Instance.LoadUIPanel("LoginPanel", () =>
            {
                UIFactory.Instance.OpenUI(GlobalValue.StageName_LoginScene, menuTypes.MAIN);
                AssetLoader.LoadAssetBundle("NpcNameLabel", AssetLoader.EAssetType.ASSET_UI, (AssetBundle bundle2, ParamData data2) =>
                {
                    nameLabel        = bundle2.mainAsset;
                    mayShowSysNotice = true;
                }, null, Configure.assetsPathstreaming);
            });
            StartCoroutine(PullResFolderName());
            //
        }
    }
Exemplo n.º 19
0
 public void LoadUIPanel(string assetsName, SceneUICallBack callback = null)
 {
     UICallBack = callback;
     UIAssetMgr.LoadUI(assetsName, LoadUICallBack, null);
 }
Exemplo n.º 20
0
 public void LoadUIPanel(UIASSETS_ID assetID, SceneUICallBack callback = null)
 {
     UICallBack = callback;
     UIAssetMgr.LoadUI(assetID, LoadUICallBack, null);
 }
Exemplo n.º 21
0
    public static void AsyncLoad(UIASSETS_ID id, bool isCollider = true)
    {
        bool mustReturn = StageMgr.Loading;

        string uiResPath = GlobalInstanceFunction.Instance.GetAssetsName((int)id, AssetLoader.EAssetType.ASSET_UI);

        if (string.IsNullOrEmpty(uiResPath))
        {
            if (id == UIASSETS_ID.UIASSETS_MessageBoxPanel)
            {
                uiResPath  = "MessageBoxPanel";
                mustReturn = false;
            }
            if (id == UIASSETS_ID.UIASSETS__ErrorTipsUI)
            {
                uiResPath  = "PromptMessgaePanel";
                mustReturn = false;
            }
            if (id == UIASSETS_ID.UIASSETS_NoticePanel)
            {
                uiResPath  = "UpdateNotice";
                mustReturn = false;
            }
            if (id == UIASSETS_ID.UIASSETS_NetWaitPanel)
            {
                uiResPath = "NetWaitPanel";
            }
        }

        if (mustReturn)
        {
            return;
        }

        if (UIManager.Instance.ContainsUI4zhizuo(uiResPath))
        {
            PopText.Instance.Show(LanguageManager.instance.GetValue("zanweikaifang"));
            return;
        }
        foreach (UIShowCmd cmd in _PanelShowStates.Values)
        {
            if (cmd == UIShowCmd.Showing)
            {
                ClientLog.Instance.Log(" return  AsyncLoad    " + id);
                if (id != UIASSETS_ID.UIASSETS_MessageBoxPanel &&
                    id != UIASSETS_ID.UIASSETS_NpcTaskPanel)
                {
                    return;
                }
            }
        }


        if (_PanelShowStates.ContainsKey(uiResPath) && _PanelShowStates[uiResPath] != UIShowCmd.Hide)
        {
            if (_PanelShown.ContainsKey(uiResPath))
            {
                _PanelShown[uiResPath].Show();
            }

            return;
        }

        _PanelShowStates[uiResPath] = UIShowCmd.Showing;

        if (UIManager.Instance.ContainsUI4Loading(uiResPath))
        {
            ApplicationEntry.Instance.ShowUILoading();
        }

        UIAssetMgr.LoadUI(uiResPath, (Assets, paramData) =>
        {
            if (null == Assets || null == Assets.mainAsset)
            {
                ApplicationEntry.Instance.HideUILoading();
                return;
            }

            GameObject go = (GameObject)GameObject.Instantiate(Assets.mainAsset) as GameObject;
            if (isCollider)
            {
                if (id != UIASSETS_ID.UIASSETS_NpcTaskPanel)
                {
                    GlobalInstanceFunction.Instance.MakeUIMask(go);
                }
            }

            UIBase ui     = go.GetComponent <UIBase>();
            ui._UIResPath = uiResPath;

            ui.AttachToGameObject(go);

            if (_PanelShowStates[uiResPath] == UIShowCmd.Hide)
            {
                ui.Hide();
            }
            else
            {
                _PanelShowStates[uiResPath] = UIShowCmd.Shown;
                _PanelShown[uiResPath]      = ui;
                ui.Show();
            }
            ApplicationEntry.Instance.HideUILoading();
        }
                          , null);
    }