diff --git a/assets/20006/script/comp/PlayerHeadInfoComp.ts b/assets/20006/script/comp/PlayerHeadInfoComp.ts index 9a5eefa..b4f212c 100644 --- a/assets/20006/script/comp/PlayerHeadInfoComp.ts +++ b/assets/20006/script/comp/PlayerHeadInfoComp.ts @@ -91,7 +91,8 @@ export class PlayerHeadInfoComp extends Game20009BaseComp{ if(this._isHandler)return this._isHandler=true console.log("下注 >> ",JSON.stringify(val)) - if(this.currentBet)GameController.getInstance().addPlayerOpt(Object.assign({},this.currentBet)) + // if(this.currentBet)GameController.getInstance().addPlayerOpt(Object.assign({},this.currentBet)) + if(this.currentBet)GameController.getInstance().addPlayerOpt(this.currentBet) if(val.userScore && this.isPlayer){ this.onUserDataChanaged(val.userScore) } @@ -124,7 +125,8 @@ export class PlayerHeadInfoComp extends Game20009BaseComp{ //用户点击了下注 private onPlayerClickBetGold(pos:Vec3,betVal:any,goldlayer:Node){ let betAmount:number=GameController.getInstance().getCurBetValue() - this.currentBet={ + if(!this.currentBet) this.currentBet=[] + const data ={ pos:pos, betArea:betVal.betArea, // betArea:betVal.areaId, @@ -132,6 +134,7 @@ export class PlayerHeadInfoComp extends Game20009BaseComp{ goldlayer:goldlayer, betAmount:betAmount } + this.currentBet.push(data) let infos:any[]=[ { betArea:betVal.betArea, diff --git a/assets/20006/script/controller/GameController.ts b/assets/20006/script/controller/GameController.ts index a547668..b3ab061 100644 --- a/assets/20006/script/controller/GameController.ts +++ b/assets/20006/script/controller/GameController.ts @@ -155,7 +155,7 @@ export class GameController extends Component{ /** 添加玩家操作记录 */ addPlayerOpt(opt:any){ if(!this._recordPlayerOpt)this._recordPlayerOpt=[] - this._recordPlayerOpt.push(opt) + this._recordPlayerOpt=opt } /**下注错误时清理错误信息 */ clearPlayerOpt(){