Ejemplo 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);
        }
    }
Ejemplo n.º 2
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");
    }
Ejemplo n.º 3
0
 public void InitArrow()
 {
     UIAssetMgr.LoadUI("jiantou", (AssetBundle bundle, ParamData data) =>
     {
         pointerPrefab_ = bundle.mainAsset;
     }, null);
 }
Ejemplo n.º 4
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);
        }
    }
Ejemplo n.º 5
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);
    }
Ejemplo n.º 6
0
 public void Init()
 {
     if (panelObj_ == null)
     {
         UIAssetMgr.LoadUI("headChatUI", (AssetBundle bundle, ParamData data) =>
         {
             panelObj_ = bundle.mainAsset;
         }, null);
     }
 }
Ejemplo n.º 7
0
 public void Init()
 {
     msgQue_ = new Queue <Pkg>();
     if (popTextObj_ == null)
     {
         UIAssetMgr.LoadUI("PopText", (AssetBundle bundle, ParamData data) =>
         {
             popTextObj_ = bundle.mainAsset;
         }, null);
     }
 }
Ejemplo n.º 8
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);
 }
Ejemplo n.º 9
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);
    }
Ejemplo n.º 10
0
 public void LoadUIPanel(string assetsName, SceneUICallBack callback = null)
 {
     UICallBack = callback;
     UIAssetMgr.LoadUI(assetsName, LoadUICallBack, null);
 }
Ejemplo n.º 11
0
 public void LoadUIPanel(UIASSETS_ID assetID, SceneUICallBack callback = null)
 {
     UICallBack = callback;
     UIAssetMgr.LoadUI(assetID, LoadUICallBack, null);
 }
Ejemplo n.º 12
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);
    }
Ejemplo n.º 13
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);
    }