99
1010/* NOTE: If you are using `TextMesh Pro` uncomment this line.
1111 */
12- // #define TMP_PRO
12+ #define TMP_PRO
1313
1414using System . Collections ;
1515using System . Collections . Generic ;
@@ -116,8 +116,8 @@ public class JCS_TextDeltaNumber
116116
117117 [ Tooltip ( "How much the delta value add up." ) ]
118118 [ SerializeField ]
119- [ Range ( 1 , 1000 ) ]
120- private int mDeltaProduct = 1 ;
119+ [ Range ( 0.01f , 1000.0f ) ]
120+ private float mDeltaProduct = 1 ;
121121
122122
123123 /* Setter/Getter */
@@ -132,7 +132,8 @@ public class JCS_TextDeltaNumber
132132 public float CurrentNumber { get { return this . mCurrentNumber ; } set { this . mCurrentNumber = value ; } }
133133 public string PreString { get { return this . mPreString ; } set { this . mPreString = value ; } }
134134 public string PostString { get { return this . mPostString ; } set { this . mPostString = value ; } }
135- public int DeltaProduct { get { return this . mDeltaProduct ; } set { this . mDeltaProduct = value ; } }
135+ public float AnimNumberTime { get { return this . mAnimNumberTime ; } set { this . mAnimNumberTime = value ; } }
136+ public float DeltaProduct { get { return this . mDeltaProduct ; } set { this . mDeltaProduct = value ; } }
136137
137138
138139 /* Functions */
@@ -196,15 +197,15 @@ private void DoDeltaCurrentScore()
196197 if ( mAnimNumberTimer < mAnimNumberTime )
197198 return ;
198199
199- float additionNumber = ( mRoundPlace == 0.0f ) ? 1.0f : 1.0f / Mathf . Pow ( 10.0f , mRoundPlace ) ;
200+ float additionNumber = 1.0f / Mathf . Pow ( 10.0f , mRoundPlace ) ;
200201
201202 bool wasLarger = ( mTargetNumber < mCurrentNumber ) ;
202203
204+ additionNumber *= mDeltaProduct ;
205+
203206 if ( wasLarger )
204207 additionNumber = JCS_Mathf . ToNegative ( additionNumber ) ;
205208
206- additionNumber *= mDeltaProduct ;
207-
208209 mCurrentNumber += additionNumber ;
209210
210211 if ( ( wasLarger && mTargetNumber > mCurrentNumber ) ||
@@ -225,7 +226,7 @@ private void UpdateTextRender()
225226#if TMP_PRO
226227 if ( mTextContainer == null && mTextMesh == null )
227228#else
228- if ( mTextContainer == null )
229+ if ( mText == null )
229230#endif
230231 {
231232 JCS_Debug . LogError ( "Text slot cannot be null references..." ) ;
0 commit comments