Пример #1
0
        /// @param newScore
        ///     The score to set
        /// @param callback
        ///     The function to call when the score finished updated
        ///
        public void SetScore(int newScore, Action callback = null)
        {
            // Update the text
            m_loopedSFX  = m_audioService.PlaySFXLooped(AudioIdentifiers.k_loopScoreCounting);
            m_tweenCount = m_scoreText.DOCount(m_score, newScore, 1.0f, () =>
            {
                m_loopedSFX.SafeStop();
                m_score = newScore;
            });

            // Update the stars
            m_coroutine = GlobalDirector.ExecuteCoroutine(StaggerStarProgress(newScore, callback));
        }
Пример #2
0
 /// @param textMesh
 ///     The text to modify
 /// @oaram amount
 ///     The amount to mount up to
 /// @oaram duration
 ///     The duration of the tween
 /// @oaram [optional] callback
 ///     The function to call when the tweener finished
 ///
 /// @return The count tweener
 ///
 public static Tweener DOCount(this TMP_Text textMesh, int amount, float duration, Action callback = null)
 {
     return(textMesh.DOCount(0, amount, duration, callback));
 }
Пример #3
0
 /// @param textMesh
 ///     The text to modify
 /// @param from
 ///     The amount to start up as
 /// @oaram to
 ///     The amount to mount up to
 /// @oaram duration
 ///     The duration of the tween
 /// @oaram [optional] callback
 ///     The function to call when the tweener finished
 ///
 /// @return The count tweener
 ///
 public static Tweener DOCount(this TMP_Text textMesh, int from, int to, float duration, Action callback = null)
 {
     return(textMesh.DOCount(k_defaultTextFormat, from, to, duration, callback));
 }