Exemplo n.º 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);
        }
Exemplo n.º 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);
     });
 }
Exemplo n.º 3
0
 public void Dispose()
 {
     if (_contentPane != null)
     {
         _contentPane.Dispose();
     }
 }
 public static void Destory()
 {
     if (gc != null)
     {
         gc.Dispose();
     }
 }
Exemplo n.º 5
0
 //
 public void Destroy()
 {
     if (main != null)
     {
         main.Dispose();
     }
 }
Exemplo n.º 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();
 }
Exemplo n.º 7
0
    public virtual void OnDestory()
    {
        GRoot.inst.RemoveChild(ViewComponent);

        ViewComponent.Dispose();

        GUIManager.IncReferenceAssetBundle(PackageName);
    }
Exemplo n.º 8
0
 //
 public void Destroy()
 {
     MsgManager.Instance.RemoveListener("SC_GetItemExtraInfo");
     if (main != null)
     {
         main.Dispose();
     }
 }
Exemplo n.º 9
0
 public static void CloseTouchShowInfo()
 {
     if (TouchShowCom != null)
     {
         TouchShowCom.Dispose();
         TouchShowCom = null;
     }
 }
Exemplo n.º 10
0
 //
 public void Destroy()
 {
     MsgManager.Instance.RemoveListener("SC_StoreData");
     AudioManager.Am.Play2DSound(AudioManager.Sound_CloseUI);
     if (main != null)
     {
         main.Dispose();
     }
 }
Exemplo n.º 11
0
 public void DisposeChatBottom()
 {
     if (_chatBottom != null)
     {
         _chatBottom.Dispose();
         _chatBottom = null;
         _te         = null;
     }
 }
Exemplo n.º 12
0
 public void Dispose()
 {
     RemoveAllLayers();
     if (_root != null)
     {
         _root.Dispose();
     }
     _root = null;
 }
Exemplo n.º 13
0
 //
 public void Destroy()
 {
     MsgManager.Instance.RemoveListener("SC_GetCharacterSimpleInfo");
     AudioManager.Am.Play2DSound(AudioManager.Sound_CloseUI);
     if (main != null)
     {
         main.Dispose();
     }
 }
Exemplo n.º 14
0
 public virtual void CloseUIPage()
 {
     _component.Dispose();
     if (SingletonManager.GetSingleton <UIManager>().UIPages.ContainsKey(_pageName))
     {
         SingletonManager.GetSingleton <UIManager>().UIPages.Remove(_pageName);
     }
     ClearUIPage();
 }
Exemplo n.º 15
0
 public virtual void Close()
 {
     if (uiComponent != null)
     {
         OnClose();
         // 销毁UI
         uiComponent.RemoveFromParent();
         uiComponent.Dispose();
     }
 }
Exemplo n.º 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();
        }
    }
Exemplo n.º 17
0
 public void RemoveLayer(GComponent layer)
 {
     if (layer != null)
     {
         if (layer.parent != null)
         {
             layer.RemoveFromParent();
         }
         layer.Dispose();
     }
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 21
0
    public void RemoveChessInfo(ChessEntity chess)
    {
        if (m_infos.ContainsKey(chess))
        {
            GComponent info = m_infos[chess];

            m_infos.Remove(chess);

            info.RemoveFromParent();

            info.Dispose();
        }
    }
Exemplo n.º 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();
        }
    }
Exemplo n.º 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;
        }
Exemplo n.º 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();
        }
    }
Exemplo n.º 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);
    }
Exemplo n.º 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");
    }
Exemplo n.º 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();
        });
    }
Exemplo n.º 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;
 }
Exemplo n.º 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"));
        }
    }
Exemplo n.º 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;
    }