private void Update() { if (Input.GetKeyDown(KeyCode.R)) { HdCdctrlInstance.ReSetHandCds(new int[0]); } }
protected override void OnAllocateCds(object sender, DdzbaseEventArgs args) { //发牌后重置开关 _isRpLeftOne = false; _isRpLeftOneFirst = false; //base.OnAllocateCds(sender,args);---------- var data = args.IsfObjData; var seat = data.GetInt(GlobalConstKey.C_Sit); if (App.GetGameData <GlobalData>().GetSelfSeat != seat || !data.ContainsKey(GlobalConstKey.C_Cards)) { return; } var cards = data.GetIntArray(GlobalConstKey.C_Cards); ResetHdCds(cards); //------------------------end------------------------------------------------------------------------ //判断发牌后是否是自己先行动出牌 if (data.ContainsKey(GlobalConstKey.C_Bkp) && data.GetInt(GlobalConstKey.C_Bkp) == App.GetGameData <GlobalData>().GetSelfSeat) { DisableAllBtns(); if (_lastOutData == null) { _lastOutData = new SFSObject(); } _lastOutData.PutInt(RequestKey.KeySeat, App.GetGameData <GlobalData>().GetSelfSeat); _lastOutData.PutIntArray(RequestKey.KeyCards, new int[] { }); if (HdCdctrlInstance != null) { HdCdctrlInstance.ReSetHandCds(HdCdsListTemp.ToArray(), true); } } else { if (HdCdctrlInstance != null) { HdCdctrlInstance.ReSetHandCds(HdCdsListTemp.ToArray(), true, true); } } }
protected override void OnRejoinGame(DdzbaseEventArgs args) { StopAllCoroutines(); //与ResetHdCds,AddHdCds,RemoveHdCds相关 base.OnRejoinGame(args); //显示手牌 HdCdctrlInstance.ReSetHandCds(HdCdsListTemp.ToArray()); var data = args.IsfObjData; int selfSeat = App.GetGameData <DdzGameData>().SelfSeat; _isMyTurn = data.ContainsKey(NewRequestKey.KeyCurrp) && data.GetInt(NewRequestKey.KeyCurrp) == selfSeat; //如果是选庄阶段则不显示出牌操作相关按钮 if (data.ContainsKey(NewRequestKey.KeyGameStatus)) { switch (data.GetInt(NewRequestKey.KeyGameStatus)) { case GlobalConstKey.StatusChoseBanker: case GlobalConstKey.StatusDouble: HideAllBtns(); return; } } //如果存在最后一次出牌的信息 if (data.ContainsKey(NewRequestKey.KeyLastOut)) { _lastOutData = data.GetSFSObject(NewRequestKey.KeyLastOut); } else { //是自己第一手出牌,你是地主 _lastOutData.PutInt(RequestKey.KeySeat, selfSeat); } //没人行动,或者,不是自己行动 if (!_isMyTurn) { HideAllBtns(); return; } if (_lastOutData.GetInt(RequestKey.KeySeat) != selfSeat) { GetPromptCardsGroup(_lastOutData); if (AutoState) { AutoFollow(); } else { OnOthersOutCds(); } } else { HideAllBtns(); SetBtnActive(ChuPaiBtn, true); SetBtnState(ChuPaiBtn, false); //如果自己准备出手牌 SetAllBtnState(); CheckCanOutOneTime(); //最后一手,如果可以全出,则全出 } }