示例#1
0
    public override void OnEnter()
    {
        base.OnEnter();
        UIDispatcher.Instance.AddEventListener(ConstDefine.BtnMyRoom, OnBtnMyRoomClick);                               //主界面我的房间按钮点击
        UIDispatcher.Instance.AddEventListener(ConstDefine.BtnSelectRoomViewRefresh, OnBtnSelectRoomViewRefreshClick); //主界面刷新按钮点击
        DelegateDefine.Instance.OnAutoJoinRoom += OnAutoJoinRoomCallBack;                                              //自动加入房间回调


        AudioBackGroundManager.Instance.Play("bgm_main");
        if (DelegateDefine.Instance.OnSceneLoadComplete != null)
        {
            DelegateDefine.Instance.OnSceneLoadComplete();
        }
        GameObject go = UIViewManager.Instance.LoadSceneUIFromAssetBundle(UIViewManager.SceneUIType.Main, () =>
        {
#if IS_TAILAI || IS_DAZHONG || IS_GUGENG
            UIViewManager.Instance.OpenWindow(UIWindowType.Ranking);
#endif
        });

        m_UISceneMainView = go.GetComponent <UISceneMainView>();
        List <cfg_gameEntity> lstEntity = cfg_gameDBModel.Instance.GetList();

        if (lstEntity != null)
        {
            m_UISceneMainView.SetUI(lstEntity, OnGameClick);
        }

        if (GlobalInit.Instance.IsAutoJoin)
        {
            OnAutoJoinRoomCallBack(GlobalInit.Instance.InviteRoomId, GlobalInit.Instance.ParentId);
        }
        else
        {
            GameCtrl.Instance.RequestRebuildRoom();
        }

        AccountCtrl.Instance.RequestCards();

        CurrentMachine.StartCoroutine(BeginRequestInform());
        RequestIcon();
    }
示例#2
0
    protected override void OnStart()
    {
        base.OnStart();
        AudioBackGroundManager.Instance.Play("bgm_main");
        if (DelegateDefine.Instance.OnSceneLoadComplete != null)
        {
            DelegateDefine.Instance.OnSceneLoadComplete();
        }
        GameObject go = UIViewManager.Instance.LoadSceneUIFromAssetBundle(UIViewManager.SceneUIType.Main);

#if IS_TAILAI || IS_DAZHONG || IS_GUGENG || IS_BAODING
        UIViewManager.Instance.OpenWindow(UIWindowType.Ranking);
#endif
        m_UISceneMainView = go.GetComponent <UISceneMainView>();
        List <cfg_gameEntity> lstEntity = cfg_gameDBModel.Instance.GetList();
        if (lstEntity != null)
        {
            m_UISceneMainView.SetUI(lstEntity, OnGameClick);
            RequestNoticeThree();
        }

        if (GlobalInit.Instance.IsAutoJoin)
        {
            OnAutoJoinRoomCallBack(GlobalInit.Instance.InviteRoomId, GlobalInit.Instance.ParentId);
        }
        else
        {
            GameCtrl.Instance.RequestRebuildRoom();
        }

        AccountCtrl.Instance.RequestCards();

        StartCoroutine(BeginRequestInform());

        OnAutoOpenWindow();//自动打开窗口

        RequestIcon();
    }