Home > other >  Why do I click on a button, will perform two ah, you great god help me to look at my code
Why do I click on a button, will perform two ah, you great god help me to look at my code

Time:09-27

If (_state==State. WhiteGo)
{

//can't have placed the pieces placed on
If (CanPlace (cross GridX, cross GridY))
{
Chess_cx=cross. GridX;
Chess_cy=cross. GridY;

If (PlaceChess (cross, false))
{
//have victory
_state=State. Over;
ShowResult (ChessType. White);
}
The else
{
//in black go
_state=State. BlackGo;
Tishi. Text=the string. Format (" spots round ");

}
Button_huiqi. OnClick. AddListener (()=& gt;
{
Int _cx=Chess_cx;
Int _cy=Chess_cy;
The Debug Log (" albino back ");
GameObject objp=_board. GetCross (_cx _cy). The GameObject.
Child in objp foreach (Transform. Transform)
{
GameObject. Destroy (child GameObject);
}
_board. _crossMap. Remove (10000 + _cy _cx *);
_model. Set (_cx _cy, 0);
_state=State. WhiteGo;
Tishi. Text=the string. Format (" albino round ");
Button_huiqi. GameObject. SetActive (false);
});
}


}

CodePudding user response:

Back button repeat? Why back operations in every click when listening

CodePudding user response:

Send all a little look not to come out this paragraph of
  • Related