/// <summary> /// 领取房卡 /// </summary> /// <param name="bytes"></param> private void GetCheckInreward(byte[] bytes) { GetCardInfoS2C package = NetMgr.Instance.DeSerializes <GetCardInfoS2C>(bytes); if (package.status == 1) { Debug.Log("领取奖励成功"); UIManager.Instance.HideUI(UIViewID.SIGNIN_VIEW); PlayerInfoProxy playerProxy = Facade.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; foreach (UserItem item in package.userItems) { if (playerProxy.UserInfo.UserItems.ContainsKey(item.type)) { playerProxy.UserInfo.UserItems[item.type] = item; } else { playerProxy.UserInfo.UserItems.Add(item.type, item); } } SendNotification(NotificationConstant.MEDI_HALL_REFRESHITEM); } else { DialogMsgVO dialogVO = new DialogMsgVO(); dialogVO.dialogType = DialogType.ALERT; dialogVO.title = "领取奖励失败"; dialogVO.content = "领取奖励失败,请检查网络连接"; DialogView dialogView = UIManager.Instance.ShowUI(UIViewID.DIALOG_VIEW) as DialogView; dialogView.data = dialogVO; } }
/// <summary> /// 验证码检验成功 /// </summary> /// <param name="bytes"></param> private void InviteCodeSucceed(byte[] bytes) { CheckInvitationCodeS2C package = NetMgr.Instance.DeSerializes <CheckInvitationCodeS2C>(bytes); if (package.status == ErrorCode.SUCCESS) { UIManager.Instance.HideUI(UIViewID.INVITE_VIEW, () => { UIManager.Instance.ShowUI(UIViewID.SHOPPING_VIEW); }); PlayerInfoProxy pip = Facade.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; if (pip.UserInfo.BoundAgency == ErrorCode.FAILT) { pip.UserInfo.BoundAgency = ErrorCode.SUCCESS; } } else { DialogMsgVO dialogVO = new DialogMsgVO(); dialogVO.dialogType = DialogType.ALERT; dialogVO.title = "输入验证码错误"; dialogVO.content = "输入验证码错误,请重新输入"; DialogView dialogView = UIManager.Instance.ShowUI(UIViewID.DIALOG_VIEW) as DialogView; dialogView.data = dialogVO; } ApplicationFacade.Instance.SendNotification(NotificationConstant.MEDI_HALL_CLEARINPUTTEXT); }
public void FrameMove(float fdt) { foreach (ProfessionRole p in m_mapOtherPlayer.Values) { p.FrameMove(fdt); } if (VIEW_PLAYER_TYPE == 0) { return; } if (GRMap.grmap_loading) { return; } foreach (ProfessionRole role in m_mapOtherPlayerUnsee.Values) { m_mapOtherPlayerUnsee.Remove(role.m_unIID); m_mapOtherPlayerSee.Add(role.m_unIID, role); FriendProxy.getInstance().addNearyByPeople(role.m_unIID); PlayerInfoProxy.getInstance().sendLoadPlayerDetailInfo(role.m_unCID); return; } }
void Awake() { battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; headBtn = transform.FindChild("Head").GetComponent <Button>(); nameTxt = transform.FindChild("NameTxt").GetComponent <Text>(); coinTxt = transform.FindChild("CoinTxt").GetComponent <Text>(); headIcon = transform.FindChild("Head/HeadIcon").GetComponent <RawImage>(); readyIcon = transform.FindChild("ReadyIcon").gameObject; bankerIcon = transform.FindChild("BankerIcon").gameObject; voicePlayIcon = transform.FindChild("VoicePlayIcon").gameObject; voiceValueIcon = transform.FindChild("VoicePlayIcon/VoiceValueIcon").GetComponent <Image>(); chatView = transform.FindChild("ChatView").gameObject; chatTxt = transform.FindChild("ChatView/ChatTxt").GetComponent <Text>(); faceIcon = transform.FindChild("FaceIcon").GetComponent <Image>(); //creatorIcon = transform.FindChild("Head/CreatorIcon").gameObject; waitingIcon = transform.FindChild("WaitingIcon").gameObject; huView = transform.FindChild("HuView"); touheObj = transform.FindChild("touhe").gameObject; baoImg = transform.FindChild("diao").GetComponent <Image>(); baoEffect = transform.FindChild("baoEffect"); //offlineIcon = transform.FindChild("Head/OfflineIcon").gameObject; headBtn.onClick.AddListener(OpenPlayerInfo); }
public override void OnRegister() { base.OnRegister(); battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; //View.readyBtn.onClick.AddListener(onReadyClick); //View.BackBtn.onClick.AddListener(OnDissloutionClick); //View.dissolutionBtn.onClick.AddListener(OnDissloutionClick); View.chatBtn.onClick.AddListener(OnChatClick); View.settingBtn.onClick.AddListener(OnSettingClick); View.inviteBtn.onClick.AddListener(OnInviteClick); View.ruleInfoBtn.onClick.AddListener(OnRuleInfoClick); View.ExitRoomBtn.onClick.AddListener(OnDissloutionClick); View.LeftRoomBtn.onClick.AddListener(OnLeftRoomBtnClick); var voideTrigger = View.voiceBtn.GetComponent <EventTrigger>(); voideTrigger.triggers = new List <EventTrigger.Entry>(); EventTrigger.Entry onUp = new EventTrigger.Entry(); onUp.eventID = EventTriggerType.PointerUp; onUp.callback.AddListener(OnVoiceUp); EventTrigger.Entry onDown = new EventTrigger.Entry(); onDown.eventID = EventTriggerType.PointerDown; onDown.callback.AddListener(OnVoiceDown); voideTrigger.triggers.Add(onDown); voideTrigger.triggers.Add(onUp); View.TouHeBtn.onClick.AddListener(OnClickTouHeBtn); View.PassBtn.onClick.AddListener(OnClickPassBtn); //View.BaoTingBtn.onClick.AddListener(OnClickBaoTing); Timer.Instance.AddTimer(0, 1, 0, InitView); }
private void GetUserID(int userID) { PlayerInfoProxy pip = Facade.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; pip.UserInfo.UserID = userID; NSocket.UserId = userID; }
// Use this for initialization void Awake() { dirIconArr = new List <GameObject>(); //dirIconPostionArr = new List<Vector3>(); battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; Time_m = transform.Find("Time_m").GetComponent <Image>(); Time_s = transform.Find("Time_s").GetComponent <Image>(); // masterIcon = transform.Find("MasterIcon").GetComponent<Image>(); var eastIcon = transform.Find("bg/EastIcon").gameObject; var southIcon = transform.Find("bg/SouthIcon").gameObject; var westIcon = transform.Find("bg/WestIcon").gameObject; var northIcon = transform.Find("bg/NorthIcon").gameObject; dirIconArr.Add(eastIcon); dirIconArr.Add(southIcon); dirIconArr.Add(westIcon); dirIconArr.Add(northIcon); //dirIconPostionArr.Add(eastIcon.transform.localPosition); //dirIconPostionArr.Add(southIcon.transform.localPosition); //dirIconPostionArr.Add(westIcon.transform.localPosition); //dirIconPostionArr.Add(northIcon.transform.localPosition); //arrowIcon = transform.Find("ArrowIcon").GetComponent<Image>(); //arrowEffect = transform.Find("ArrowIcon/ArrowEffect").gameObject; }
public override void OnRegister() { base.OnRegister(); battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; View.startNextBtn.onClick.AddListener(OnStartNextClick); //View.shareBtn.onClick.AddListener(OnShaderClick); InitUI(); }
void Awake() { //InitSimulationCard(); instance = this; battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; Application.logMessageReceived += HandleLog; }
public override void OnRegister() { base.OnRegister(); playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; View.UserName.text = playerInfoProxy.userName; GameMgr.Instance.StartCoroutine(DownIcon(playerInfoProxy.headIconUrl)); this.View.ButtonAddListening(this.View.CloseButton, () => { PlayerPrefs.SetFloat(PrefsKey.SOUNDSET, this.View.SoundSlider.value); PlayerPrefs.SetFloat(PrefsKey.MUSICSET, this.View.MusicSlider.value); PlayerPrefs.SetInt(PrefsKey.LUANAGE, this.View.BackGround.isOn ? 1 : -1); UIManager.Instance.HideUI(UIViewID.SETTING_VIEW); }); this.View.ButtonAddListening(this.View.SwitchAccountButton, () => { UIManager.Instance.Background.color = new Color(1, 1, 1, 0); UIManager.Instance.Background.gameObject.SetActive(true); UIManager.Instance.Background.DOColor(new Color(1, 1, 1, 1), 0.5f).SetEase(Ease.Linear).OnComplete( () => { if (Application.platform == RuntimePlatform.Android) { PlayerPrefs.DeleteKey(PrefsKey.USERMAC); PlayerPrefs.DeleteKey(PrefsKey.USERNAME); PlayerPrefs.DeleteKey(PrefsKey.HEADURL); PlayerPrefs.DeleteKey(PrefsKey.SEX); } var loadInfo = new LoadSceneInfo(ESceneID.SCENE_LOGIN, LoadSceneType.SYNC, LoadSceneMode.Single); ApplicationFacade.Instance.SendNotification(NotificationConstant.MEDI_GAMEMGR_LOADSCENE, loadInfo); }); }); this.View.MusicSlider.onValueChanged.AddListener( (float value) => { PlayerPrefs.SetFloat(PrefsKey.MUSICSET, value); AudioSystem.Instance.SetBgmAudioVolume(PlayerPrefs.GetFloat(PrefsKey.MUSICSET)); }); this.View.SoundSlider.onValueChanged.AddListener( (float value) => { PlayerPrefs.SetFloat(PrefsKey.SOUNDSET, value); AudioSystem.Instance.SetEffectAudioVolume(PlayerPrefs.GetFloat(PrefsKey.SOUNDSET)); }); this.View.CheckMark.onValueChanged.AddListener( (bool isOn) => { }); this.View.BackGround.onValueChanged.AddListener( (bool isOn) => { }); }
void Awake() { gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy; battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; for (int i = 0; i < 10; i++) { ssSprite.Add(Resources.Load <Sprite>("Textures/saizi/" + i)); } }
private void LoginResponse(byte[] bytes) { Debug.Log("收到登陆响应"); LoginS2C package = NetMgr.Instance.DeSerializes <LoginS2C>(bytes); int loginStatus = package.status; if (loginStatus == 1) { Debug.Log("验证成功"); int userID = package.userId; hallServerIP = package.serverIp; hallServerPort = package.port; ((GameMgrProxy)Facade.RetrieveProxy(Proxys.GAMEMGR_PROXY)).systemTime = package.time; PlayerInfoProxy pip = Facade.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; pip.userID = userID; NSocket.UpdateUserID(userID); NetMgr.Instance.StopTcpConnection(SocketType.LOGIN); NetMgr.Instance.CreateConnect(SocketType.HALL, hallServerIP, hallServerPort, HallConnectHandler); } else if (loginStatus == 2) { DialogMsgVO dialogVO = new DialogMsgVO(); dialogVO.dialogType = DialogType.ALERT; dialogVO.title = "登录失败"; dialogVO.content = "版本过低,请点击确认下载最新版本"; dialogVO.confirmCallBack = () => { if (Application.platform == RuntimePlatform.Android) { Application.OpenURL(package.androidUrl); } else if (Application.platform == RuntimePlatform.IPhonePlayer) { Application.OpenURL(package.iosUrl); } else { Application.OpenURL(package.androidUrl); } }; DialogView dialogView = UIManager.Instance.ShowUI(UIViewID.DIALOG_VIEW) as DialogView; dialogView.data = dialogVO; } else { DialogMsgVO dialogVO = new DialogMsgVO(); dialogVO.dialogType = DialogType.ALERT; dialogVO.title = "登录失败"; dialogVO.content = "登录失败,请重新连接"; DialogView dialogView = UIManager.Instance.ShowUI(UIViewID.DIALOG_VIEW) as DialogView; dialogView.data = dialogVO; } }
public override void OnRegister() { base.OnRegister(); this.hallProxy = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy; this.playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; this.View.ButtonAddListening(this.View.CloseButton, () => { UIManager.Instance.HideUI(UIViewID.CREATEROOM_VIEW); }); this.View.FourModeInfo.Toggle.onValueChanged.AddListener( (bool isOn) => { this.ChangeGameModel(isOn,this.View.FourModeInfo.Model); this.View.NotWord.Toggle.interactable = false; }); this.View.EightModeInfo.Toggle.onValueChanged.AddListener( (bool isOn) => { this.ChangeGameModel(isOn, this.View.EightModeInfo.Model); this.View.NotWord.Toggle.interactable = false; }); this.View.SixteenModeInfo.Toggle.onValueChanged.AddListener( (bool isOn) => { this.ChangeGameModel(isOn, this.View.SixteenModeInfo.Model); this.View.NotWord.Toggle.interactable = true; }); this.View.CapScore.Toggle.onValueChanged.AddListener( (bool isOn)=> { this.ChangeGameCap(isOn,this.View.CapScore.Cap); } ); this.View.NotWord.Toggle.onValueChanged.AddListener( (bool isOn)=> { this.View.FourModeInfo.Toggle.interactable = false; this.View.EightModeInfo.Toggle.interactable = false; this.ChangeGameRule(isOn, this.View.NotWord.Rule); }); this.View.Word.Toggle.onValueChanged.AddListener( (bool isOn)=> { this.View.FourModeInfo.Toggle.interactable = true; this.View.EightModeInfo.Toggle.interactable = true; this.ChangeGameRule(isOn, this.View.Word.Rule); } ); this.View.ButtonAddListening(this.View.CreateButton, SendCreateRoom); this.hallProxy.HallInfo.Innings = (int)(GameMode.FOUR_ROUND); }
/// <summary> /// 刷新玩家货币 /// </summary> private void RefreshItem() { PlayerInfoProxy playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; if (playerInfoProxy.userItems.ContainsKey(ItemType.DIAMONDS)) { View.TopView.roomCardText.text = playerInfoProxy.userItems [ItemType.DIAMONDS].amount.ToString(); } else { View.TopView.roomCardText.text = "0"; } }
public override void OnRegister() { base.OnRegister(); battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; View.recorder.OnReComplete = SendAudioToServer; View.recorder.OnGetComplete = PlayAudio; AudioSystem.Instance.PlayBgm(Resources.Load <AudioClip>("Voices/Bgm/BattleBgm")); InitView(); }
/// <summary> /// 刷新玩家货币 /// </summary> private void RefreshItem() { PlayerInfoProxy playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; if (playerInfoProxy.UserInfo.UserItems.ContainsKey(ItemType.ROOMCARD)) { View.TopView.RoomCardText.text = playerInfoProxy.UserInfo.UserItems[ItemType.ROOMCARD].amount.ToString(); } else { View.TopView.RoomCardText.text = "0"; } }
/// <summary> /// 下载回调 /// </summary> /// <param name="headUrl"></param> /// <returns></returns> IEnumerator DownIcon(string headUrl) { WWW www = new WWW(headUrl); yield return(www); if (www.error == null) { PlayerInfoProxy playerProxy = Facade.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; playerProxy.headIcon = www.texture; View.TopView.photoIcon.texture = www.texture; } }
public override void OnRegister() { base.OnRegister(); this.playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; this.View.ButtonAddListening(this.View.CloseButton, () => { UIManager.Instance.HideUI(UIViewID.PLATER_INFO_VIEW); }); //刷新用户信息 //this.RefreshPlayerInfo(); }
public override void OnRegister() { base.OnRegister(); hallProxy = Facade.RetrieveProxy(Proxys.HALL_PROXY) as HallProxy; playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; View.ButtonAddListening(this.View.CloseButton, () => { UIManager.Instance.HideUI(UIViewID.CREATEROOM_VIEW); }); View.ButtonAddListening(this.View.CreateButton, SendCreateRoom); //hallProxy.HallInfo.innings = GameMode.EIGHT_ROUND; //hallProxy.HallInfo.gameRule = GameRule.WORD; }
/// <summary> /// 刷新用户大厅界面 /// </summary> private void RefreshUserInfo() { PlayerInfoProxy playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; View.TopView.Username.text = playerInfoProxy.UserInfo.ShowID; GameMgr.Instance.StartCoroutine(DownIcon(playerInfoProxy.UserInfo.HeadIconUrl)); if (playerInfoProxy.UserInfo.UserItems.ContainsKey(ItemType.ROOMCARD)) { View.TopView.RoomCardText.text = playerInfoProxy.UserInfo.UserItems[ItemType.ROOMCARD].amount.ToString(); } else { View.TopView.RoomCardText.text = "0"; } }
/// <summary> /// 绑定顶部UI按钮事件 /// </summary> private void TopMenuAddEvent() { View.TopView.ButtonAddListening(View.TopView.photoButton, () => { if (GlobalData.LoginServer != "127.0.0.1") { PlayerInfoProxy playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; var getPlayerInfoC2S = new GetUserInfoByIdC2S(); getPlayerInfoC2S.userId = playerInfoProxy.userID; NetMgr.Instance.SendBuff(SocketType.HALL, MsgNoC2S.C2S_Hall_Get_UserInfo_By_Id.GetHashCode(), 0, getPlayerInfoC2S); } else { UIManager.Instance.ShowUI(UIViewID.PLATER_INFO_VIEW); } }); View.TopView.ButtonAddListening(View.TopView.roomCardButton, () => { UIManager.Instance.ShowUI(UIViewID.SHOPPINGTIPS_VIEW); //PlayerInfoProxy pip = Facade.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; //if (pip.boundAgency == ErrorCode.SUCCESS) //{ // UIManager.Instance.ShowUI(UIViewID.SHOPPING_VIEW); //} //else if (pip.boundAgency == ErrorCode.FAILT) //{ // UIManager.Instance.ShowUI(UIViewID.INVITE_VIEW); //} }); View.TopView.ButtonAddListening(View.TopView.signinButton, () => { UIManager.Instance.ShowUI(UIViewID.SIGNIN_VIEW); }); View.TopView.ButtonAddListening(View.TopView.helpButton, () => { UIManager.Instance.ShowUI(UIViewID.HELP_VIEW); }); View.TopView.ButtonAddListening(View.TopView.backButton, () => { UIManager.Instance.Background.color = new Color(1, 1, 1, 0); UIManager.Instance.Background.gameObject.SetActive(true); UIManager.Instance.Background.DOColor(new Color(1, 1, 1, 1), 0.5f).SetEase(Ease.Linear).OnComplete( () => { var loadInfo = new LoadSceneInfo(ESceneID.SCENE_LOGIN, LoadSceneType.SYNC, LoadSceneMode.Single); ApplicationFacade.Instance.SendNotification(NotificationConstant.MEDI_GAMEMGR_LOADSCENE, loadInfo); }); }); }
void Awake() { instance = this; battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; Application.logMessageReceived += HandleLog; for (int i = 0; i < GlobalData.CardWare.Length; i++) { GlobalData.Test127Queue.Enqueue(GlobalData.CardWare[i]); } for (int i = 0; i < defaultCardIndex.Length; i++) { defaultCardIndex[i] = GlobalData.Test127Queue.Dequeue(); } }
/// <summary> /// 刷新用户大厅界面 /// </summary> private void RefreshUserInfo() { PlayerInfoProxy playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; View.TopView.usernameTxt.text = playerInfoProxy.userName; View.TopView.userIdTxt.text = "ID:" + playerInfoProxy.showID; GameMgr.Instance.StartCoroutine(DownIcon(playerInfoProxy.headIconUrl)); if (playerInfoProxy.userItems.ContainsKey(ItemType.DIAMONDS)) { View.TopView.roomCardText.text = playerInfoProxy.userItems [ItemType.DIAMONDS].amount.ToString(); } else { View.TopView.roomCardText.text = "0"; } }
/// <summary> /// 绑定底部UI按钮事件 /// </summary> private void BottomMenuAddEvent() { View.BottomView.ButtonAddListening(View.BottomView.shopButton, () => { PlayerInfoProxy pip = Facade.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; if (pip.boundAgency == ErrorCode.SUCCESS) { UIManager.Instance.ShowUI(UIViewID.SHOPPING_VIEW); } else if (pip.boundAgency == ErrorCode.FAILT) { UIManager.Instance.ShowUI(UIViewID.INVITE_VIEW); } }); View.BottomView.ButtonAddListening(View.BottomView.shareButton, () => { UIManager.Instance.ShowUI(UIViewID.SHARE_VIEW); }); View.BottomView.ButtonAddListening(View.BottomView.militaryExploitsButton, () => { UIManager.Instance.ShowUI(UIViewID.GRADE_VIEW); if (GlobalData.LoginServer == "127.0.0.1") { ClientAIMgr.Instance.PlayReport(); } }); View.BottomView.ButtonAddListening(View.BottomView.newsButton, () => { UIManager.Instance.ShowUI(UIViewID.NEWS_VIEW); }); View.BottomView.ButtonAddListening(View.BottomView.RuleBtn, () => { View.BottomView.PanelObj.SetActive(false); UIManager.Instance.ShowUI(UIViewID.RULE_VIEW); }); View.BottomView.ButtonAddListening(View.BottomView.SettingBtn, () => { View.BottomView.PanelObj.SetActive(false); UIManager.Instance.ShowUI(UIViewID.SETTING_VIEW); }); }
void Awake() { battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; headBtn = transform.Find("Head").GetComponent <Button>(); nameTxt = transform.Find("NameTxt").GetComponent <Text>(); coinTxt = transform.Find("CoinTxt").GetComponent <Text>(); headIcon = transform.Find("Head/HeadIcon").GetComponent <RawImage>(); readyIcon = transform.Find("ReadyIcon").gameObject; bankerIcon = transform.Find("BankerIcon").gameObject; voicePlayIcon = transform.Find("VoicePlayIcon").gameObject; chatView = transform.Find("ChatView").gameObject; chatTxt = transform.Find("ChatView/ChatTxt").GetComponent <Text>(); faceIcon = transform.Find("FaceIcon").GetComponent <Image>(); waitingIcon = transform.Find("WaitingIcon").gameObject; huView = transform.Find("Huview"); headBtn.onClick.AddListener(OpenPlayerInfo); }
/// <summary> /// 绑定顶部UI按钮事件 /// </summary> private void TopMenuAddEvent() { View.TopView.ButtonAddListening(View.TopView.PhotoButton, () => { PlayerInfoProxy playerInfoProxy = Facade.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; var playerInfoView = UIManager.Instance.ShowUI(UIViewID.PLATER_INFO_VIEW) as PlayerInfoView; var playerInfoVO = new GetUserInfoByIdS2C(); playerInfoVO.userId = playerInfoProxy.UserInfo.UserID; playerInfoView.data = playerInfoVO; }); View.TopView.ButtonAddListening(View.TopView.RoomCardButton, () => { UIManager.Instance.ShowUI(UIViewID.SHOPPING_VIEW); }); View.TopView.ButtonAddListening(View.TopView.ShareButton, () => { UIManager.Instance.ShowUI(UIViewID.SHARE_VIEW); }); View.TopView.ButtonAddListening(View.TopView.GradeButton, () => { UIManager.Instance.ShowUI(UIViewID.GRADE_VIEW); } ); View.TopView.ButtonAddListening(View.TopView.SettingButton, () => { UIManager.Instance.ShowUI(UIViewID.SETTING_VIEW); } ); View.TopView.ButtonAddListening(View.TopView.HelpButton, () => { UIManager.Instance.ShowUI(UIViewID.HELP_VIEW); }); }
public override void OnRegister() { base.OnRegister(); battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYERINFO) as PlayerInfoProxy; this.View.ButtonAddListening(this.View.CloseButton, () => { PlayerPrefs.SetFloat(PrefsKey.SOUNDSET, this.View.SoundSlider.value); PlayerPrefs.SetFloat(PrefsKey.MUSICSET, this.View.MusicSlider.value); PlayerPrefs.SetInt(PrefsKey.LUANAGE, this.View.LanguageToggle.isOn?1:-1); UIManager.Instance.HideUI(UIViewID.SETTING_VIEW); }); //声音 this.View.MusicSlider.onValueChanged.AddListener( (float value) => { PlayerPrefs.SetFloat(PrefsKey.MUSICSET, value); AudioSystem.Instance.SetBgmAudioVolume(PlayerPrefs.GetFloat(PrefsKey.MUSICSET)); }); this.View.SoundSlider.onValueChanged.AddListener( (float value) => { PlayerPrefs.SetFloat(PrefsKey.SOUNDSET, value); AudioSystem.Instance.SetEffectAudioVolume(PlayerPrefs.GetFloat(PrefsKey.SOUNDSET)); }); this.View.LanguageToggle.onValueChanged.AddListener( (bool isok) => { //AudioSystem.Instance.SetLanguageType(isok); } ); //设置界面退出提示框 SettingPrompt(); }
// Use this for initialization void Awake() { dirIconArr = new List <GameObject>(); dirIconPostionArr = new List <Vector3>(); battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; gameMgrProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.GAMEMGR_PROXY) as GameMgrProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; remainTimeTxt = transform.Find("RemainTimeTxt").GetComponent <TextMesh>(); masterIcon = transform.Find("MasterIcon").GetComponent <SpriteRenderer>(); eastIcon = transform.Find("EastIcon").gameObject; southIcon = transform.Find("SouthIcon").gameObject; westIcon = transform.Find("WestIcon").gameObject; northIcon = transform.Find("NorthIcon").gameObject; dirIconArr.Add(eastIcon); dirIconArr.Add(southIcon); dirIconArr.Add(westIcon); dirIconArr.Add(northIcon); dirIconPostionArr.Add(eastIcon.transform.localPosition); dirIconPostionArr.Add(southIcon.transform.localPosition); dirIconPostionArr.Add(westIcon.transform.localPosition); dirIconPostionArr.Add(northIcon.transform.localPosition); arrowContainer = transform.Find("ArrowContainer"); arrowIcon = transform.Find("ArrowContainer/ArrowIcon").GetComponent <SpriteRenderer>(); }
// Use this for initialization void Awake() { battleProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.BATTLE_PROXY) as BattleProxy; playerInfoProxy = ApplicationFacade.Instance.RetrieveProxy(Proxys.PLAYER_PROXY) as PlayerInfoProxy; handCards = new List <GameObject>(); pengGangCards = new List <List <GameObject> >(); putCards = new List <GameObject>(); if (GlobalData.hasHeap) { if (GameObject.Find("SelfCardCamera")) { myselfCamera = GameObject.Find("SelfCardCamera").GetComponent <Camera>(); } else { myselfCamera = Camera.main; } heapCards = new List <GameObject>(); } defaultCardIdList = new List <int>(); var handFirstCard = transform.Find("Card/Card1"); var handSecondCard = transform.Find("Card/Card2"); var handLastCard = transform.Find("Card/Card13"); getCardContainer = transform.Find("Card/GetCard"); var pengGangFirstCard = transform.Find("PengGangCard/PengGangCard1"); var pengGangSecondCard = transform.Find("PengGangCard/PengGangCard2"); var putFirstCard = transform.Find("PutCard/PutCard1"); var putSecondCard = transform.Find("PutCard/PutCard2"); var putThirdCard = transform.Find("PutCard/PutCard3"); handCardContainer = transform.Find("Card"); firstCard = transform.Find("Card/Card1"); handCardGap = handSecondCard.localPosition - handFirstCard.localPosition; getHandCardGap = getCardContainer.localPosition - handLastCard.localPosition; sendCard = transform.Find("Card/SendCard"); pengGangCardContainer = transform.Find("PengGangCard"); pengGangGap = pengGangSecondCard.localPosition - pengGangFirstCard.localPosition; putCardContainer = transform.Find("PutCard"); putCardHGap = putSecondCard.localPosition - putFirstCard.localPosition; putCardVGap = putThirdCard.localPosition - putFirstCard.localPosition; if (GlobalData.hasHeap) { heapCardContainer = transform.Find("HeapCard"); heapFirstCard = transform.Find("HeapCard/HeapCard1"); var heapSecondCard = transform.Find("HeapCard/HeapCard2"); var heapThirdCard = transform.Find("HeapCard/HeapCard3"); heapHGap = heapThirdCard.localPosition - heapFirstCard.localPosition; heapVGap = heapSecondCard.localPosition - heapFirstCard.localPosition; foreach (Transform card in heapCardContainer) { defaultCardIdList.Add(card.gameObject.GetInstanceID()); } } foreach (Transform card in handCardContainer) { defaultCardIdList.Add(card.gameObject.GetInstanceID()); } foreach (Transform card in pengGangCardContainer) { defaultCardIdList.Add(card.gameObject.GetInstanceID()); } foreach (Transform card in putCardContainer) { defaultCardIdList.Add(card.gameObject.GetInstanceID()); } }