Example #1
0
        public bool OpenWindow(WindowName windowName)
        {
            UIMedia createCommand = GetCreateCommand(windowName.Key);

            if (createCommand != null)
            {
                GComponent component = createCommand.Inject();

                if (component != null)
                {
                    if (lastWindow != null && lastWindowContent != null && lastDispose != null)
                    {
                        if (lastDispose.Disposable)
                        {
                            lastWindowContent.Dispose();
                        }
                    }

                    if (lastWindow == null)
                    {
                        lastWindow       = new Window();
                        lastWindow.name  = "ModalWindow";
                        lastWindow.modal = true;
                    }

                    lastDispose = component as UIMdeiaDispose;

                    lastWindowContent = component;
                    lastWindow.AddChild(component);
                    lastWindow.Show();
                    return(true);
                }
            }
            return(false);
        }
Example #2
0
 public void ForceUpdataUI(string url)
 {
     if (loadingView != null)
     {
         loadingView.Dispose();
     }
     view.GetController("type").selectedIndex = 2;
     view.GetChild("UpDateGameBtn").asButton.onClick.Set(() => {
         Application.OpenURL(url);
     });
 }
 public void Dispose()
 {
     if (_contentPane != null)
     {
         _contentPane.Dispose();
     }
 }
 public static void Destory()
 {
     if (gc != null)
     {
         gc.Dispose();
     }
 }
Example #5
0
 //
 public void Destroy()
 {
     if (main != null)
     {
         main.Dispose();
     }
 }
Example #6
0
 void OnDestroy()
 {
     Timers.inst.Remove(TimeHandle);
     GlobalDispatcher.GetInstance().RemoveEventListener(NotiConst.LOADER_COMPLETED, OnCompleted);
     GlobalDispatcher.GetInstance().RemoveEventListener(NotiConst.LOADER_PROGRESS, OnProgress);
     GlobalDispatcher.GetInstance().RemoveEventListener(NotiConst.LOADER_ALL_COMPLETED, OnAllCompleted);
     loader.Dispose();
 }
Example #7
0
    public virtual void OnDestory()
    {
        GRoot.inst.RemoveChild(ViewComponent);

        ViewComponent.Dispose();

        GUIManager.IncReferenceAssetBundle(PackageName);
    }
Example #8
0
 //
 public void Destroy()
 {
     MsgManager.Instance.RemoveListener("SC_GetItemExtraInfo");
     if (main != null)
     {
         main.Dispose();
     }
 }
Example #9
0
 public static void CloseTouchShowInfo()
 {
     if (TouchShowCom != null)
     {
         TouchShowCom.Dispose();
         TouchShowCom = null;
     }
 }
Example #10
0
 //
 public void Destroy()
 {
     MsgManager.Instance.RemoveListener("SC_StoreData");
     AudioManager.Am.Play2DSound(AudioManager.Sound_CloseUI);
     if (main != null)
     {
         main.Dispose();
     }
 }
 public void DisposeChatBottom()
 {
     if (_chatBottom != null)
     {
         _chatBottom.Dispose();
         _chatBottom = null;
         _te         = null;
     }
 }
Example #12
0
 public void Dispose()
 {
     RemoveAllLayers();
     if (_root != null)
     {
         _root.Dispose();
     }
     _root = null;
 }
Example #13
0
 //
 public void Destroy()
 {
     MsgManager.Instance.RemoveListener("SC_GetCharacterSimpleInfo");
     AudioManager.Am.Play2DSound(AudioManager.Sound_CloseUI);
     if (main != null)
     {
         main.Dispose();
     }
 }
Example #14
0
 public virtual void CloseUIPage()
 {
     _component.Dispose();
     if (SingletonManager.GetSingleton <UIManager>().UIPages.ContainsKey(_pageName))
     {
         SingletonManager.GetSingleton <UIManager>().UIPages.Remove(_pageName);
     }
     ClearUIPage();
 }
Example #15
0
 public virtual void Close()
 {
     if (uiComponent != null)
     {
         OnClose();
         // 销毁UI
         uiComponent.RemoveFromParent();
         uiComponent.Dispose();
     }
 }
Example #16
0
    //
    public void Destroy()
    {
        MsgManager.Instance.RemoveListener("SC_GetBattleRankInfo");
        MsgManager.Instance.RemoveListener("SC_GetBattleMapInfo");

        AudioManager.Am.Play2DSound(AudioManager.Sound_CloseUI);
        if (main != null)
        {
            main.Dispose();
        }
    }
Example #17
0
 public void RemoveLayer(GComponent layer)
 {
     if (layer != null)
     {
         if (layer.parent != null)
         {
             layer.RemoveFromParent();
         }
         layer.Dispose();
     }
 }
Example #18
0
 //
 public void Destroy()
 {
     if (main != null)
     {
         main.Dispose();
         AudioManager.Am.Play2DSound(AudioManager.Sound_CloseUI);
     }
     MsgManager.Instance.RemoveListener("SC_UnitInfo");
     MsgManager.Instance.RemoveListener("SC_BagInfo");
     IsDestroy = true;
 }
Example #19
0
        public virtual void OnDispose()
        {
            RUIType = RUIType.Close;

            GRoot.inst.asCom.RemoveChild(GComponent, true);

            GComponent?.Dispose();
            GComponent = null;

            uILogic_Button?.Dispose();
            uILogic_Button = null;
        }
Example #20
0
        /// <summary>
        /// 界面销毁
        /// </summary>
        public virtual void Clear()
        {
            if (m_Container != null)
            {
                if (!Application.isPlaying)
                {
                    EMRenderSupport.Remove(this);
                }

                if (_ui != null)
                {
                    _ui.Dispose();
                    _ui = null;
                }

                GameEntry.FairyGui.RemovePackage(m_PackagePath);
                m_Container.Dispose();
                m_Container = null;
            }

            _renders = null;
        }
    public void RemoveChessInfo(ChessEntity chess)
    {
        if (m_infos.ContainsKey(chess))
        {
            GComponent info = m_infos[chess];

            m_infos.Remove(chess);

            info.RemoveFromParent();

            info.Dispose();
        }
    }
Example #22
0
    //
    public void Destroy()
    {
        MsgManager.Instance.RemoveListener("SC_GetActivityMapsInfo");
        MsgManager.Instance.RemoveListener("SC_GetMapInfo");
        MsgManager.Instance.RemoveListener("SC_GotoActivityMap");
        MsgManager.Instance.RemoveListener("SC_GetDuoBaoInfo");

        AudioManager.Am.Play2DSound(AudioManager.Sound_CloseUI);
        if (main != null)
        {
            main.Dispose();
        }
    }
Example #23
0
        /// <summary>
        /// 界面销毁
        /// </summary>
        protected override void OnDestroy()
        {
            base.OnDestroy();

            if (m_Container != null)
            {
                if (!Application.isPlaying)
                {
                    EMRenderSupport.Remove(this);
                }

                if (_ui != null)
                {
                    _ui.Dispose();
                    _ui = null;
                }

                GameEntry.FairyGui.RemovePackage(m_PackagePath);
                m_Container.Dispose();
                m_Container = null;
            }

            _renders = null;
        }
Example #24
0
    //
    public void Destroy()
    {
        MsgManager.Instance.RemoveListener("SC_GetExchangeShortCommoditys");
        MsgManager.Instance.RemoveListener("SC_GetExchangeDetailedCommoditys");
        MsgManager.Instance.RemoveListener("SC_GetSellUIInfo");
        MsgManager.Instance.RemoveListener("SC_GetWorldAuctionItems");



        AudioManager.Am.Play2DSound(AudioManager.Sound_CloseUI);
        if (main != null)
        {
            main.Dispose();
        }
    }
Example #25
0
    void LoadScene(int sceneid, string name)
    {
        if (m_GameScene != null)
        {
            CleanScene();
        }


        GComponent loading = UIPackage.CreateObject("GameUI", "Loading").asCom;

        GRoot.inst.AddChild(loading);
        Vector2 screenPos      = new Vector2(Screen.width / 2, Screen.height / 2);
        Vector2 logicScreenPos = GRoot.inst.GlobalToLocal(screenPos);

        loading.xy = logicScreenPos;

        ResourceLoadAsync.Instance.AddLoad(name, (re) => {
            Debug.Log("--ResourceLoadAsync:" + re.isDone + "   :" + re.progress + "  time:" + Tool.GetTime());
            loading.GetChild("loadingbar").asProgress.value = re.progress * 100;
            if (re.isDone)
            {
                m_GameScene = (GameObject)Instantiate(re.asset);

                //System.Threading.Thread.Sleep(5000);
                //ab
                //ABManager.LoadAB();

                var pos = new Vector3(m_GameScene.transform.position.x, 0, m_GameScene.transform.position.z);
                m_PlaneScene.SetNormalAndPosition(m_GameScene.transform.up, pos);
                loading.Dispose();

                //SceneManager.LoadScene(0);

                //通知服务器加载完成
                Protomsg.CS_LodingScene msg1 = new Protomsg.CS_LodingScene();
                msg1.SceneID = sceneid;
                MyKcp.Instance.SendMsg(m_ServerName, "CS_LodingScene", msg1);
            }
        });


        //m_GameScene = (GameObject)Instantiate(Resources.Load(name));

        //var pos = new Vector3(m_GameScene.transform.position.x, 0, m_GameScene.transform.position.z);
        //m_PlaneScene.SetNormalAndPosition(m_GameScene.transform.up, pos);

        Debug.Log("SC_NewScene:" + name);
    }
Example #26
0
    public void ForceUpdataCheckFailUI()
    {
        Debug.Log("ForceUpdataCheckFailUI");
        if (loadingView != null)
        {
            loadingView.Dispose();
        }

        if (failView != null)
        {
            return;
        }

        failView = UIPackage.CreateObject("public", "PromptPop").asCom;

        failView.SetSize(GRoot.inst.width, GRoot.inst.height);
        failView.AddRelation(GRoot.inst, RelationType.Size);
        GRoot.inst.AddChild(failView);
        failView.GetController("Prompt").selectedIndex = 11;
        failView.GetChild("Text2").asTextField.text    = "检查更新失败,请确认网络连接后重试";
        failView.GetChild("n9").asButton.onClick.Set(() => {
            if (Application.internetReachability == NetworkReachability.NotReachable)
            {
                return;
            }
            failView.Dispose();
            failView = null;
            Debug.Log("main");
            AppFacade.Instance.StartUp();  //启动游戏
            Debug.Log("StartUp");
            if (gameManager == null)
            {
                gameManager = new GameManager();
            }
            gameManager.AddComponent();
            Timers.inst.Add(1, 1, (pa) => {
                gameManager.Init();
            });

            //gameManager.CheckForceUpdata();
        });
        failView.GetChild("CloseBtn").asButton.visible = false;


        Debug.Log("检查强制更新失败UI");
    }
Example #27
0
    public static void NoticeWordsAnim(string word, Google.Protobuf.Collections.RepeatedField <string> p, string anim, int pos = 1)
    {
        // pos 1上 2中 3下
        var showpos = Tool.GetPosition(0.5f, 0.2f);

        if (pos == 1)
        {
            showpos = Tool.GetPosition(0.5f, 0.2f);
        }
        else if (pos == 2)
        {
            showpos = Tool.GetPosition(0.5f, 0.5f);
        }
        else if (pos == 3)
        {
            showpos = Tool.GetPosition(0.5f, 0.8f);
        }
        GComponent words = UIPackage.CreateObject("GameUI", "NoticeWords").asCom;

        //1,直接加到GRoot显示出来
        GRoot.inst.AddChild(words);
        //GRoot.inst.SetChildIndex(words, 1);
        words.xy = showpos;// Tool.GetPosition(0.5f, 0.2f);
        //var root = words.GetComponent<FairyGUI.UIPanel>().ui;

        words.GetChild("word").asTextField.text = word;// noticewords.Words;

        if (p != null && p.Count > 0)
        {
            int index = 1;
            foreach (var item in p)
            {
                Debug.Log("---------------NoticeWords:" + item);
                words.GetChild("word").asTextField.SetVar("p" + index, item);
                index++;
            }
            words.GetChild("word").asTextField.FlushVars();
        }


        FairyGUI.Transition trans = words.GetTransition(anim);
        trans.Play();
        trans.SetHook("over", () => {
            words.Dispose();
        });
    }
Example #28
0
 private void DestroyLodingUI()
 {
     if (_lodingView != null)
     {
         _lodingView.Dispose();
     }
     _lodingView = null;
     if (_msgText != null)
     {
         _msgText.Dispose();
     }
     _msgText = null;
     if (_msgProgress != null)
     {
         _msgProgress.Dispose();
     }
     _msgProgress = null;
 }
Example #29
0
    public virtual void Clear()
    {
//		Debug.LogError("onRemovedFromStage  " + uiName);
        ClearListener();
        if (view != null)
        {
            view.onRemovedFromStage.Remove(Clear);
        }
        view.Dispose();
        group.Dispose();
        if (title != null)
        {
            title.Dispose();
        }
        if (ModelRole.isUploadOver == true)
        {
            ModelRole.isUploadOver = false;
            ViewManager.inst.ShowText(Tools.GetMessageById("13165"));
        }
    }
Example #30
0
    public void SetPai(string pai)
    {
        this.pai = pai;

        if (_front != null)
        {
            _front.Dispose();
            _front = null;
        }

        if (pai != "")
        {
            _front       = UIPackage.CreateObject("baijiale", pai).asCom;
            _front.pivot = new Vector2(0.5f, 0.5f);
            parent.AddChild(_front);
            _front.displayObject.perspective = _back.displayObject.perspective;
        }

        Visible = Visible;
    }