Beispiel #1
0
 private void Init()
 {
     PathSystem.Init();
     if (Application.get_isPlaying() && Application.get_isEditor())
     {
         string text = Application.get_dataPath() + "/StreamingAssets/resources2json.txt";
     }
     Object.DontDestroyOnLoad(base.get_gameObject());
     FileSystem.Init();
     PreloadUIBaseSystem.Init();
     GamePackets.Register();
     base.InvokeRepeating("Tick", 0f, 0.03f);
     Loom.Current.Init();
     this.InitBugly();
     base.get_gameObject().AddComponent <RemoteLogSender>();
     if (GameManager.IsDebug)
     {
         return;
     }
     CamerasMgr.CameraUI.set_enabled(false);
     this.OpenPreloadingUI();
     PreloadingUIView.SetProgressName("正在初始化环境...");
     Screen.set_sleepTimeout(-1);
     Debug.Log("SystemInfo.deviceModel = " + SystemInfoTools.GetDeviceModel());
     this.CurrentUpdateManager = new UpdateManager();
     this.CurrentUpdateManager.Init();
     this.CheckUpdate();
 }
Beispiel #2
0
    public void OpenUI_Async(string prefabName, Action <UIBase> finish_callback = null, Transform parent = null)
    {
        int iD = UIID.GetID(prefabName);

        if (iD <= 0)
        {
            Debug.LogError("ui id is illegal, prefab name = " + prefabName);
            return;
        }
        WaitUI.OpenUI(0u);
        UINameTable dataNT = DataReader <UINameTable> .Get(iD);

        if (parent == null)
        {
            parent = WidgetSystem.GetRoot(dataNT.parent);
        }
        bool flag = false;

        if (dataNT.hideTheVisible == 1)
        {
            flag = true;
        }
        UIType type = (UIType)dataNT.type;

        if (this.IsOpen(dataNT.name))
        {
            UIBase uIIfExist = this.GetUIIfExist(dataNT.name);
            uIIfExist.get_transform().SetParent(parent);
            uIIfExist.get_transform().set_localPosition(Vector3.get_zero());
            uIIfExist.get_transform().set_localRotation(Quaternion.get_identity());
            uIIfExist.get_transform().set_localScale(Vector3.get_one());
            this.RefreshlistOpenUI(uIIfExist, true);
            WaitUI.CloseUI(0u);
            if (finish_callback != null)
            {
                finish_callback.Invoke(uIIfExist);
            }
            return;
        }
        if (!UIManagerControl.IsSpecialUI(dataNT.name))
        {
            UIStateSystem.LockOfWaitOpenUI(dataNT.name);
        }
        if (flag || type == UIType.FullScreen)
        {
            this.HideAllInNormalUIRoot(dataNT.name);
        }
        AssetManager.AssetOfTPManager.LoadAtlas(PreloadUIBaseSystem.GetPreloads(dataNT.name), delegate
        {
            this.LoadUI(dataNT.name, parent, type, delegate(UIBase ub)
            {
                if (ub == null)
                {
                    if (!UIManagerControl.IsSpecialUI(dataNT.name))
                    {
                        EventDispatcher.Broadcast <string>("UIManagerControl.UIOpenOfSuccess", dataNT.name);
                    }
                    Debug.LogError("加载失败 : " + dataNT.name);
                    WaitUI.CloseUI(0u);
                    if (finish_callback != null)
                    {
                        finish_callback.Invoke(null);
                    }
                    return;
                }
                if (!UIManagerControl.IsSpecialUI(dataNT.name))
                {
                    GuideManager.Instance.CheckQueue(false, false);
                }
                this.RefreshlistOpenUI(ub, true);
                ub.Show(true);
                if (!UIManagerControl.IsSpecialUI(dataNT.name))
                {
                    GuideManager.Instance.CheckQueue(true, false);
                    EventDispatcher.Broadcast("GuideManager.LevelNow");
                }
                WaitUI.CloseUI(0u);
                if (finish_callback != null)
                {
                    finish_callback.Invoke(ub);
                }
            });
        }, 0);
    }