Exemple #1
0
 private void OnGO(Vector3 pos, int number, bool isCorrect, System.Action onComplete)
 {
     Map.Cell cell = NumberSelector.selectedCell;
     transform.localPosition = pos;
     gameObject.SetActive(true);
     _text.text = number.ToString();
     UAnimation.Make(gameObject)
     .MoveTo(MapRenderer.CalculateCellPosition(cell.row, cell.col))
     .Duration(0.5f)
     .Ease(UAnimation.EaseType.Linear)
     .Go(delegate() {
         if (isCorrect)
         {
             gameObject.SetActive(false);
             onComplete();
         }
         else
         {
             UAnimation.Make(gameObject)
             .MoveTo(pos)
             .Duration(0.5f)
             .Ease(UAnimation.EaseType.Linear)
             .Go(delegate() {
                 gameObject.SetActive(false);
                 onComplete();
             });
         }
     });
 }