示例#1
0
 void Awake()
 {
     button         = GetComponent <Button>();
     buttonText     = transform.GetComponentInChildren <Text>();
     levelInfoPanel = GameObject.Find("LevelInfoPanel");
     canvasScript   = GameObject.Find("Canvas").GetComponent <HomeUI>();
 }
示例#2
0
        private void homeButton_Click(object sender, EventArgs e)
        {
            HomeUI newForm = new HomeUI();

            newForm.Show();
            this.Hide();
        }
示例#3
0
 private void Awake()
 {
     instance = this;
     //
     SocketManager.ListenDelegate(true, messageHandle, OperationListenInfo);
     GameEventDispatcher.addListener(ItemCountChangeEvent.ITEM_COUNT_CHAGE_EVENT_TAG, ItemChangeEventLister);
 }
示例#4
0
        private void InitializeFrontEndUI()
        {
            try
            {
                //Create Home UI
                log.Info("Home UI is set ");
                homeUI = new HomeUI(this);
                this.Controls.Add(homeUI);
                homeUI.setVisible();

                //Create Game UI
                log.Info("Game UI is set ");
                gameUI = new GameUI(this);
                this.Controls.Add(gameUI);


                //Create Result UI
                log.Info("Result UI is set");
                resultUI = new ResultUI(this);
                this.Controls.Add(resultUI);
            } catch (Exception ex)
            {
                MetroMessageBox.Show(this, String.Format("Error : {0}", ex.Message), "", MessageBoxButtons.OK, MessageBoxIcon.Error, 150);

                log.Info(String.Format("Error : {0}", ex.Message));
            }
        }
示例#5
0
 void Awake()
 {
     if (_instance != null)
     {
         Destroy(this.gameObject);
     }
     _instance = this;
 }
示例#6
0
        private async CTask ShowHomeUI(ProcedureOwner procedureOwner)
        {
            homeUi           = Mgr.UI.Show <HomeUI>();
            homeUi.procedure = this;
            await homeUi.Await();

            LoadingUI.Hide();
        }
示例#7
0
 public void GotoGame(UnityEngine.Video.VideoPlayer vp)
 {
     PrePlayUI.SetActive(false);
     MainUI.SetActive(false);
     HomeUI.SetActive(true);
     ShieldHandler.Instance.RefreshShield();
     Screen.orientation = ScreenOrientation.LandscapeLeft;
     GameUI.SetActive(true);
     ShieldHandler.Instance.RefreshShield();
     _SpawnRef.StartSpawn();
 }
示例#8
0
    private void Awake()
    {
        if (Instance != null && Instance != this.gameObject)
        {
            Destroy(gameObject);
            return;
        }

        Instance = this;
        DontDestroyOnLoad(gameObject);
    }
示例#9
0
 public void Update()
 {
     if (serverEvent.Count > 0)
     {
         MessageXieYi xieyi = serverEvent.Dequeue();
         if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.getRoommateInfo)
         {
             ErrorType error = ClassGroup.CheckIsError(xieyi);
             if (error != ErrorType.none)
             {
                 Debug.LogError(error);
             }
             else
             {
                 HomeUI.Close();
                 Debug.Log("根据玩家数据刷新房间UI");
                 ReflashBtnReady();
                 ReflashRoomInfo();
                 ReflashRoomState();
             }
         }
         if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.updateActorState)
         {
             ErrorType error = ClassGroup.CheckIsError(xieyi);
             if (error != ErrorType.none)
             {
                 Debug.LogError(error);
             }
             else
             {
                 string          messageInfo     = SerializeHelper.ConvertToString(xieyi.MessageContent);
                 RoomActorUpdate roomActorUpdate = new RoomActorUpdate();
                 roomActorUpdate.SetSendInfo(messageInfo);
                 RoomActorState state = (RoomActorState)int.Parse(roomActorUpdate.update);
                 if (state == RoomActorState.Ready || state == RoomActorState.NoReady || state == RoomActorState.Offline)
                 {
                     ReflashRoomState();
                 }
             }
         }
         if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.updateRoom)
         {
             ErrorType error = ClassGroup.CheckIsError(xieyi);
             if (error != ErrorType.none)
             {
                 Debug.LogError(error);
             }
             else
             {
                 UpdateUIInfo();
             }
         }
     }
 }
示例#10
0
 private void StartGaming()
 {
     HomeUI.Close();
     if (CurrentPlayType == FramePlayType.游戏未开始)
     {
         Debug.Log("开始游戏");
         frameIndex      = 0;
         CurrentPlayType = FramePlayType.准备UI;
     }
     else
     {
         //这个应该是udp断线时TCP消息到了
     }
 }
示例#11
0
        /// <summary>
        /// Displays the HomeUI tab or brings it to the front if it is already open
        /// </summary>
        public void PopHome()
        {
            if (_home == null)
            {
                _home = new HomeUI(this.ActivateItems);

                _homeContent         = _windowFactory.Create(ActivateItems, _home, "Home", FamFamFamIcons.application_home);
                _homeContent.Closed += (s, e) => _home = null;
                _homeContent.Show(_mainDockPanel, DockState.Document);
            }
            else
            {
                _homeContent.Activate();
            }
        }
示例#12
0
 public void Transition()
 {
     if (ShieldHandler.Instance.isNew)
     {
         PrePlayUI.SetActive(true);
         HomeUI.SetActive(false);
     }
     else
     {
         MainUI.SetActive(false);
         Screen.orientation = ScreenOrientation.LandscapeLeft;
         GameUI.SetActive(true);
         ShieldHandler.Instance.RefreshShield();
         _SpawnRef.StartSpawn();
     }
 }
示例#13
0
        /// <summary>
        /// 网站首页数据源
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        public HomeUI Home(BookQuery query)
        {
            var list = book.GetList(query);

            HomeUI home = new HomeUI()
            {
                PublishHouseId = query.PublishHouseId,
                ParentType     = query.ParentType,
                SubType        = query.SubType,
                HoustList      = publishHouseRepository.GetList(),
                Parent         = bookTypeRepository.GetParentList(),
                Children       = query.ParentType > 0? bookTypeRepository.GetChildList(query.ParentType):null,
                QueryList      = list
            };

            return(home);
        }
示例#14
0
        private void chartsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (homeUi != null)
            {
                homeUi.Close();
                homeUi = null;
            }
            if (libraryUi != null)
            {
                libraryUi.Close();
                libraryUi = null;
            }

            if (chartsUi == null)
            {
                chartsUi           = new ChartsUI();
                chartsUi.MdiParent = this;
                chartsUi.Show();
            }
        }
示例#15
0
 private void Awake()
 {
     instance = this;
 }
示例#16
0
    public void Update()
    {
        if (serverEventTCP.Count > 0)
        {
            MessageXieYi xieyi = serverEventTCP.Dequeue();
            if (xieyi == null)
            {
                Debug.LogError("有事件操作的协议为空?");
                return;
            }
            if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.login)
            {
                ErrorType error = ClassGroup.CheckIsError(xieyi);
                if (error != ErrorType.none)
                {
                    ErrorShow(error);
                }
                else
                {
                    SocketManager.instance.GetBeatTime();
                }
            }
            if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.getHeartBeatTime)
            {
                ErrorType error = ClassGroup.CheckIsError(xieyi);
                if (error != ErrorType.none)
                {
                    Debug.LogError(error);
                }
                else
                {
                    SocketManager.instance.OpenHeartbeat();
                    //
                    UILogin.Close();
                    HomeUI.Show();
                    //
                    Debug.Log("自身检查是否需要重连。");
                    SocketManager.instance.SendSave((byte)MessageConvention.reConnectCheck, new byte[] { }, false);
                }
            }
            if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.reConnectCheck)
            {
                ErrorType error = ClassGroup.CheckIsError(xieyi);
                if (error != ErrorType.none)
                {
                    Debug.LogError(error);
                }
                else
                {
                    ReconnctInfo rcInfo = SerializeHelper.Deserialize <ReconnctInfo>(xieyi.MessageContent);
                    if (rcInfo.isReconnect)
                    {
                        CurrentPlayType = FramePlayType.断线重连;
                        ReConnectUI.Show();
                    }
                    else
                    {
                        CurrentPlayType = FramePlayType.游戏未开始;
                    }
                }
            }
            if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.quitRoom)//自己退出房间
            {
                QuitInfo qInfo = SerializeHelper.Deserialize <QuitInfo>(xieyi.MessageContent);
                if (qInfo.isQuit)
                {
                    UpdateMemberHide();
                    RoomUI.Close();
                    HomeUI.Show();
                    if (qInfo.userIndex != DataController.instance.MyLocateIndex)
                    {
                        UIManager.instance.ShowAlertTip("您被踢出房间。");
                    }
                }
                else
                {
                    if (qInfo.userIndex == qInfo.quitUnique)
                    {
                        UIManager.instance.ShowAlertTip("退出房间失败。");
                    }
                }
            }
            if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.updateActorState)
            {
                ErrorType error = ClassGroup.CheckIsError(xieyi);
                if (error != ErrorType.none)
                {
                    Debug.LogError(error);
                }
                else
                {
                    CheckState(xieyi);
                }
            }
            if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.updateModelInfo)
            {
                GameModelData modelDate = SerializeHelper.Deserialize <GameModelData>(xieyi.MessageContent);
                SetPrepareData(modelDate);
            }
            if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.getPreGameData)
            {
                ErrorType error = ClassGroup.CheckIsError(xieyi);
                if (error != ErrorType.none)
                {
                    Debug.LogError(error);
                }
                else
                {
                    Debug.Log("验证本客户端收到游戏前准备数据。客户端响应已收到:" + xieyi.MessageContentLength);
                    SendState(RoomActorState.WaitForStart);
                }
            }
            if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.startGaming)
            {
                ErrorType error = ClassGroup.CheckIsError(xieyi);
                if (error != ErrorType.none)
                {
                    Debug.LogError(error);
                }
                else
                {
                    StartGaming();
                }
            }
            if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.endGaming)
            {
                ErrorType error = ClassGroup.CheckIsError(xieyi);
                if (error != ErrorType.none)
                {
                    Debug.LogError(error);
                }
                else
                {
                    EndGaming(xieyi);
                }
            }
            if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.frameData)
            {
                Debug.LogError("TCP收到整串操作数据");
                UDPManager.instance.DealFrameData(xieyi);
                if (CurrentPlayType == FramePlayType.断线重连)
                {
                    CurrentPlayType = FramePlayType.游戏中;
                }
                if (CurrentPlayType == FramePlayType.主动请求数据)
                {
                    CurrentPlayType = FramePlayType.游戏中;
                }
            }
        }

        //UDP
        if (serverEventUDP.Count > 0)
        {
            MessageXieYi xieyi = serverEventUDP.Dequeue();
            if (xieyi == null)
            {
                Debug.LogError("有UDP事件操作的协议为空?");
                return;
            }
            if (xieyi.XieYiFirstFlag == (byte)MessageConvention.setUDP)
            {
                UDPManager.instance.IsConnect = true;
                Debug.LogError("用tcp 设置房间 udp");
                //SocketManager.instance.SendSave((byte)MessageConvention.setUDP, xieyi.MessageContent, false);
            }
        }
    }
 private void homeButton_Click(object sender, EventArgs e)
 {
     var homeUI = new HomeUI();
 }
示例#18
0
 public void OnnClickEnter()
 {
     Close();
     HomeUI.Show();
 }