Browse Source

下注成功了不下注

master
cristianoxin 4 months ago
parent
commit
15101d33f9
  1. 7
      assets/20006/script/comp/PlayerHeadInfoComp.ts
  2. 2
      assets/20006/script/controller/GameController.ts

7
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,

2
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(){

Loading…
Cancel
Save