Ejemplo n.º 1
0
 //Coroutine#########################################################################
 private IEnumerator RebuildLayout(BottomUIButtonCotroller _caller)
 {
     while (true)
     {
         LayoutRebuilder.ForceRebuildLayoutImmediate(this.ButtonParent);
         for (int i = 0; i < this.ButtonArray.Length; ++i)
         {
             this.ButtonArray[i].UpdateButtonFrontPos();
         }
         if (_caller.transform.localScale.x == BottomUIButtonCotroller.CLICKED_SCALE_X)
         {
             break;
         }
         yield return(null);
     }
 }
Ejemplo n.º 2
0
 private IEnumerator MoveButtonCover(BottomUIButtonCotroller _caller)
 {
     while (true)
     {
         Vector2 moveDir = _caller.RectTransform.localPosition - this.ButtonCover.localPosition;
         if (_caller.transform.localScale.x == BottomUIButtonCotroller.CLICKED_SCALE_X &&
             moveDir.magnitude <= BUTTONCOVER_MOVE_SPEED * Time.deltaTime)
         {
             this.ButtonCover.localPosition = _caller.RectTransform.localPosition;
             break;
         }
         this.ButtonCover.localPosition += (Vector3)moveDir * BUTTONCOVER_MOVE_SPEED * Time.deltaTime;
         yield return(null);
     }
     this.buttonCoverMoveCoroutine = null;
 }
Ejemplo n.º 3
0
 public void SetCurrentButton(BottomUIButtonCotroller _caller)
 {
     this.currentButtonType = _caller.Type;
     for (int i = 0; i < this.ButtonArray.Length; ++i)
     {
         if (this.ButtonArray[i] != _caller)
         {
             this.ButtonArray[i].Declick();
         }
     }
     StartCoroutine(RebuildLayout(_caller));
     if (this.buttonCoverMoveCoroutine != null)
     {
         StopCoroutine(this.buttonCoverMoveCoroutine);
     }
     this.buttonCoverMoveCoroutine = StartCoroutine(MoveButtonCover(_caller));
 }