private void _ShowOuterFateCard(int id, bool isHostPlayerTurn, PlayerInfo player) { var cardController = UIControllerManager.Instance.GetController <UIOuterFateCardController> (); var tmpOutefate = GameModel.GetInstance.netOuterFateCard; var playerArr = PlayerManager.Instance.Players; var showbaord = true; if (GameModel.GetInstance.isPlayNet == true) { //如果是轮到玩家,本来就是自己,那就显示 if (PlayerManager.Instance.IsHostPlayerTurn() == true) { cardController.playerInfor = player; cardController.cardData = tmpOutefate; cardController.setVisible(true); CardManager.Instance.fateIDList.Add(id); } else { for (var i = playerArr.Length - 1; i >= 0; i--) { cardController.playerInfor = playerArr[i]; cardController.cardData = tmpOutefate; if (i > 0) { } else { if (playerArr [i].isEnterInner == false) { //如果是轮到玩家,本来就是自己,那就显示 if (cardController.IsEffectAll() == true) { cardController.setVisible(true); } else { //有卡牌去显示 if (cardController.IsFateToSale() == true) { cardController.setVisible(true); } else { showbaord = false; NetWorkScript.getInstance().QuitCard(GameModel.GetInstance.curRoomId, tmpOutefate.id, (int)SpecialCardType.outFate); //后面打开 } } } else { NetWorkScript.getInstance().QuitCard(GameModel.GetInstance.curRoomId, tmpOutefate.id, (int)SpecialCardType.outFate); //后面打开 } } } } if (playerArr [0].isEnterInner == true || showbaord == false) { if (GameModel.GetInstance.isPlayNet == false) { Client.Unit.BattleController.Instance.Send_RoleSelected(1); } } } }
private void _OnClickSureHandler(GameObject go) { NetWorkScript.getInstance().AgreeQuitGame(); _HideButton(); }
private void _BorrowFriendHandler(GameObject go) { NetWorkScript.getInstance().ReadyBorrowFried(); }
private void _ShowCenter() { NetWorkScript.getInstance().startToNetGame(); _isaddrobot = false; EventTriggerListener.Get(btn_cancle.gameObject).onClick += _OnClickCancleHandler; }
public bool HandlerCardData() { var canHandle = false; var turnIndex = Client.Unit.BattleController.Instance.CurrentPlayerIndex; var heroInfor = PlayerManager.Instance.Players[turnIndex]; //保险 if (heroInfor.totalMoney + paymeny < 0) { Console.WriteLine("余额不足了"); MessageHint.Show(SubTitleManager.Instance.subtitle.lackOfGold); canHandle = false; return(canHandle); } else { if (GameModel.GetInstance.isPlayNet == false) { if (heroInfor.InsuranceList.Count > 0) { MessageHint.Show("您已经购买保险,不能重复购买"); return(false); } MessageHint.Show("购买保险成功"); heroInfor.totalMoney += paymeny; heroInfor.totalPayment -= paymeny; canHandle = true; // MessageHint.Show (string.Format(SubTitleManager.Instance.subtitle.innerFateSafe2,heroInfor.playerName,title),null,true); heroInfor._buyCareNum += 1; heroInfor.InsuranceList.Add(90001); var borrowController = UIControllerManager.Instance.GetController <UIBorrowWindowController> (); borrowController.UpdateBorrowBoardMoney(); } else if (GameModel.GetInstance.isPlayNet == true) { NetWorkScript.getInstance().Game_BuyEnsurance(GameModel.GetInstance.curRoomId, Math.Abs((int)paymeny)); } } if (GameModel.GetInstance.isPlayNet == false) { var battleController = UIControllerManager.Instance.GetController <UIBattleController>(); if (null != battleController) { if (PlayerManager.Instance.IsHostPlayerTurn()) { battleController.SetQualityScore((int)heroInfor.qualityScore, heroInfor.targetQualityScore); battleController.SetTimeScore((int)heroInfor.timeScore, heroInfor.targetTimeScore); battleController.SetNonLaberIncome((int)heroInfor.CurrentIncome, (int)heroInfor.TargetIncome); battleController.SetCashFlow((int)heroInfor.totalMoney, heroInfor.TargetIncome); } else { battleController.SetPersonInfor(heroInfor, turnIndex); } } } return(canHandle); }
/// <summary> /// 关闭窗口 /// </summary> /// <param name="go"></param> private void _OnCloseHandler(GameObject go) { this._hideNewPlayerGuid(); //NetWorkScript.getInstance ().RequestReadyInRoom (GameModel.GetInstance.myHandInfor.uuid,GameModel.GetInstance.curRoomId); NetWorkScript.getInstance().RequestExitRoom(GameModel.GetInstance.myHandInfor.uuid, GameModel.GetInstance.curRoomId); }
/// <summary> /// Shows the chance shares card. 显示股票卡牌的信息 /// </summary> /// <param name="id">Identifier.</param> /// <param name="isHostPlayerTurn">If set to <c>true</c> is host player turn.</param> /// <param name="player">Player.</param> private void _ShowChanceSharesCard(int id, bool isHostPlayerTurn, PlayerInfo player) { var cardController = UIControllerManager.Instance.GetController <UIChanceShareCardController> (); var tmpShare = GameModel.GetInstance.netChanceShareCard; // player.PlayerIntegral += value.rankScore; //player.Settlement._smallIntegral += tmpShare.rankScore; player.Settlement._smallOpportunitiesTotalNum += 1; var playerArr = PlayerManager.Instance.Players; var showBoard = true; cardController.playerInfor = player; cardController.cardData = tmpShare; //cardController.setVisible(true); CardManager.Instance.chanceIDList.Add(id); if (PlayerManager.Instance.IsHostPlayerTurn() == true) { cardController.playerInfor = player; cardController.cardData = tmpShare; cardController.IsOnlyShow = false; cardController.setVisible(true); CardManager.Instance.chanceIDList.Add(id); } else { for (var i = playerArr.Length - 1; i >= 0; i--) { cardController.playerInfor = playerArr[i]; cardController.cardData = tmpShare; if (i > 0) { } else { if (playerArr[i].isEnterInner == false) { if (cardController.HasSameTypeShare() == false) { showBoard = false; NetWorkScript.getInstance().QuitCard(GameModel.GetInstance.curRoomId, tmpShare.id, (int)SpecialCardType.sharesChance);//后面打开 } else { cardController.IsOnlyShow = false; cardController.setVisible(true); } } else { showBoard = false; NetWorkScript.getInstance().QuitCard(GameModel.GetInstance.curRoomId, tmpShare.id, (int)SpecialCardType.sharesChance);//后面打开 } } } } if (playerArr [0].isEnterInner == true || showBoard == false) { cardController.IsOnlyShow = true; cardController.setVisible(true); //Client.Unit.BattleController.Instance.Send_RoleSelected (1); } }
/// <summary> /// 点击准备游戏开始 /// </summary> /// <param name="go"></param> private void _OnClickReadyHandler(GameObject go) { NetWorkScript.getInstance().MatchEnterGame(GameModel.GetInstance.myHandInfor.uuid); //NetWorkScript.getInstance ().RequestReadyInRoom (GameModel.GetInstance.myHandInfor.uuid,GameModel.GetInstance.curRoomId); }
private void _OnSendPacketHandler(GameObject go) { Audio.AudioManager.Instance.BtnMusic(); var player = PlayerManager.Instance.HostPlayerInfo; int cashCount = GetCashCount(); // if (cashCount > MaxCashCount) // { // MessageHint.Show("红包金额过高。"); // } if (cashCount > player.totalMoney) { MessageHint.Show("您没有这么多钱。"); } else if (cashCount < MinCashCount) { MessageHint.Show("请输入大于0的金额"); } else { // string _redText="<color=#e53232>{0}</color>"; // string _greenText="<color=#00b050>+{0}</color>"; // MessageHint.Show("红包发送成功~!"); //TODO 此处应该调用通用接口,玩家减少这些钱,NPC增加这些钱 //MessageHint.Show(string.Format("您给<color=#00b050>{0}</color>包了一个<color=#f1df17>{1}</color>元的红包",_controller.player.playerName,cashCount.ToString())); MessageTips.Show(string.Format(GameTipManager.Instance.gameTips.overOuterSendRed, _controller.player.playerName)); if (GameModel.GetInstance.isPlayNet == false) { player.totalMoney -= cashCount; var battleControll = UIControllerManager.Instance.GetController <UIBattleController>(); if (null != battleControll) { battleControll.SetCashFlow((int)player.totalMoney, -1); if (GameModel.GetInstance.isPlayNet == false) //单机状态下,刷新目标玩家的金币 { _controller.player.totalMoney += cashCount; var index = Array.IndexOf(PlayerManager.Instance.Players, _controller.player); if (index > 0) { battleControll.SetPersonInfor(_controller.player, index); } } } } if (cashCount > 0) { Audio.AudioManager.Instance.Tip_RedPackage(PlayerManager.Instance.HostPlayerInfo.careerID); } if (GameModel.GetInstance.isPlayNet == true) { NetWorkScript.getInstance().Send_RedPocket(GameModel.GetInstance.curRoomId, -cashCount); } _ClosePanel(); } }
private void _OnCancleMatch() { NetWorkScript.getInstance().CancleMatchGame(GameModel.GetInstance.myHandInfor.uuid); }
/// <summary> /// Ons the click pai hang. 显示排行榜 /// </summary> /// <param name="go">Go.</param> private void _OnClickPaiHang(GameObject go) { return; NetWorkScript.getInstance().GameRank_Active(); }
/// <summary> /// 处理登录后返回的数据 /// </summary> /// <param name="value"></param> /// <param name="callback"></param> private void _handLoginBack(string value, Action callback = null) { GameModel.GetInstance.HideNetLoading(); var data = JsonMapper.ToObject(value); var status = int.Parse(data["status"].ToString()); var msg = data["msg"].ToString(); //登录成功 if (status == 0) { var isShowBoard = false; if (((IDictionary)data ["data"]).Contains("bind")) { var isBind = int.Parse(data["data"]["bind"].ToString()); if (isBind == 0) { _showBindInforBoard(); } else if (isBind == 1) { isShowBoard = true; } } else { isShowBoard = true; } if (isShowBoard == true) { if (((IDictionary)data ["data"]).Contains("need")) { var isneed = int.Parse(data ["data"] ["need"].ToString()); if (isneed == 0) { _showPlayerInforBoard(); } else { NetWorkScript.getInstance().init(); var role = data ["data"] ["player"]; var nickname = role ["name"].ToString(); var headimg = role ["avatar"].ToString(); var sex = int.Parse(role ["gender"].ToString()); var uuid = role ["id"].ToString(); var birth = ""; if (((IDictionary)role).Contains("birthday")) { birth = role["birthday"].ToString(); } GameModel.GetInstance.setPlayerInfor(nickname, sex, uuid, headimg, birth); if (null != callback) { callback(); } } } } } else { //失败 MessageHint.Show(msg); } }
private void _OnClickCancleHandler(GameObject go) { NetWorkScript.getInstance().RefuseQuitGame(); _HideButton(); }