This repository was archived by the owner on Mar 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -223,9 +223,10 @@ protected override void OnPopulateMesh(VertexHelper vh)
223223 frame = Mathf . FloorToInt ( frameProgress * textureSheetAnimation . numTilesX ) ;
224224
225225 int row = textureSheetAnimation . rowIndex ;
226- // if (textureSheetAnimation.useRandomRow) { // FIXME - is this handled internally by rowIndex?
227- // row = Random.Range(0, textureSheetAnimation.numTilesY, using: particle.randomSeed);
228- // }
226+ if ( textureSheetAnimation . rowMode == ParticleSystemAnimationRowMode . Random )
227+ { // FIXME - is this handled internally by rowIndex?
228+ row = Mathf . Abs ( ( int ) particle . randomSeed % textureSheetAnimation . numTilesY ) ;
229+ }
229230 frame += row * textureSheetAnimation . numTilesX ;
230231 break ;
231232
@@ -234,7 +235,7 @@ protected override void OnPopulateMesh(VertexHelper vh)
234235 frame %= textureSheetAnimationFrames ;
235236
236237 particleUV . x = ( frame % textureSheetAnimation . numTilesX ) * textureSheetAnimationFrameSize . x ;
237- particleUV . y = 1.0f - Mathf . FloorToInt ( frame / textureSheetAnimation . numTilesX ) * textureSheetAnimationFrameSize . y ;
238+ particleUV . y = 1.0f - ( ( frame / textureSheetAnimation . numTilesX ) + 1 ) * textureSheetAnimationFrameSize . y ;
238239 particleUV . z = particleUV . x + textureSheetAnimationFrameSize . x ;
239240 particleUV . w = particleUV . y + textureSheetAnimationFrameSize . y ;
240241 }
You can’t perform that action at this time.
0 commit comments