void InitializeCounter(UICounter counter)
    {
        GameObject counterGO = counter.gameObject;

        counter.onBeginCounting += increase => {
            counterGO.LeanCancel();
            counterGO.LeanScale(_counterCountingScale, _counterScalingTime);
        };
        counter.onEndCounting += increase => {
            counterGO.LeanCancel();
            counterGO.LeanScale(Vector3.one, _counterScalingTime);
        };
    }
    IEnumerator ProcessOnReplay()
    {
        if (GameManager.instance.replayInterstitialEnabled)
        {
            bool closed = false;

            Action <bool> onClosed = state => {
                closed = true;
                if (state)
                {
                    GameManager.instance.ResetReplayInterstitialTime();
                }
            };

            NetworkManager.Instance.ShowInterstitialAd(
                GameConstants.ADUNIT_INTERSTITIAL_GAMEEND_REPLAY,
                onClosed
                );

            while (!closed)
            {
                yield return(new WaitForEndOfFrame());
            }
        }

        UICounter coinCounter = GetParam <UICounter>(PARAM_COIN_COUNTER, null);

        if (coinCounter != null)
        {
            coinCounter.Setup(DataManager.Instance.UserData.Coin);
            while (coinCounter.nowCounting)
            {
                yield return(new WaitForEndOfFrame());
            }

            yield return(new WaitForSeconds(1.0f));
        }

        NetworkManager.Instance.UnLoadRewardVideoAd(GameConstants.ADUNIT_REWARD);
        StateManager.instance.OpenStateForced(GameConstants.STATENAME_INGAME);
    }
 void ResetCounter(UICounter counter)
 {
     counter.LeanCancel();
     counter.transform.localScale = Vector3.one;
 }