Exemple #1
0
 internal override void Click(UnitControllButton _button)
 {
     if (this.active)
     {
         _button.ImageMask.gameObject.SetActive(true);
         float boardClickPosX = Camera.main.ScreenToWorldPoint(Input.mousePosition).x - _button.transform.position.x;
         if (boardClickPosX < 0.0f)
         {
             _button.ImageMask.transform.localPosition = new Vector2(-buttonWidth * 0.25f, 0.0f);
             _button.MyControllBoard.SetControll(_button.MyControllBoard.ClickOnMoveOption(), this.pieceType);
         }
         else
         {
             _button.ImageMask.transform.localPosition = new Vector2(buttonWidth * 0.25f, 0.0f);
             _button.MyControllBoard.SetControll(_button.MyControllBoard.ClickOnAttackOption(), this.pieceType);
         }
     }
     else
     {
         this.active = true;
         _button.ImageMask.gameObject.SetActive(false);
         _button.MyControllBoard.SetControll(_button.MyControllBoard.ClickNoOption(), Unit.Piece.PieceType.End);
         if (this.coroutine != null)
         {
             _button.StopCoroutine(this.coroutine);
         }
         this.coroutine = _button.StartCoroutine(this.MoveImageLeft(_button));
     }
 }
Exemple #2
0
 internal override void DeactiveButton(UnitControllButton _button)
 {
     this.active = false;
     if (this.coroutine != null)
     {
         _button.StopCoroutine(this.coroutine);
     }
     this.coroutine = _button.StartCoroutine(this.MoveImageRight(_button));
 }
Exemple #3
0
 internal override void Click(UnitControllButton _button)
 {
     if (this.active)
     {
         _button.ImageMask.gameObject.SetActive(true);
         _button.ImageMask.transform.localPosition = new Vector2(-buttonWidth * 0.25f, 0.0f);
         _button.MyControllBoard.SetControll(_button.MyControllBoard.ClickOnBuildOption(), this.buildingType, this.cost);
     }
     else
     {
         this.active = true;
         _button.ImageMask.gameObject.SetActive(false);
         _button.MyControllBoard.SetControll(_button.MyControllBoard.ClickNoOption(), Unit.Piece.PieceType.End);
         if (this.coroutine != null)
         {
             _button.StopCoroutine(this.coroutine);
         }
         this.coroutine = _button.StartCoroutine(this.MoveImageLeft(_button));
     }
 }