예제 #1
0
    public void ButtonGameTaiXiuClick()
    {
        if (isOpen)
        {
            ButtonOpenMenu();
        }

        if (!UILayerController.Instance.IsLayerExisted(UILayerKey.LGameTaiXiu))
        {
#if USE_XLUA
            var uiLayer = UILayerController.Instance.GetLayer(UILayerKey.LViewLobby);
            if (uiLayer != null && UILayerController.Instance.IsCurrentLayer(UILayerKey.LViewLobby))
            {
                var lViewLobby = uiLayer.gameObject.GetComponent <XLuaBehaviour>();

                ViewElementGame element = lViewLobby.InvokeXLua("GetElementGameById", GameId.TAIXIU)[0] as ViewElementGame;

                if (element != null)
                {
                    VKDebug.LogColorRed("Open game", element.gameId.ToString());
                    element.openGame();
                    return;
                }
            }
            DownloadGame(GameId.TAIXIU);
#else
            LViewLobby lLobby = UILayerController.Instance.GetLayer <LViewLobby>();
            if (lLobby != null && UILayerController.Instance.IsCurrentLayer(UILayerKey.LViewLobby))
            {
                var element = lLobby.GetElementGameById(GameId.TAIXIU);
                if (element != null)
                {
                    element.openGame();
                    return;
                }
            }
            DownloadGame(GameId.TAIXIU);
#endif
        }
        else
        {
            UILayerController.Instance.FocusMiniGame(UILayerKey.LGameTaiXiu);
        }
    }
예제 #2
0
 public void Init(LViewLobby viewLobby)
 {
     this.viewLobby = viewLobby;
     this.viewLobby.noticeRun.InitNoticeNotice();
     Show();
 }