Merged in patch/uiparticlesystem-texture (pull request #104)
Patch supplied by contributor to improve the texture sheet use with the UIParticlesystempull/413/head
commit
0ab5e6edf7
|
@ -223,9 +223,10 @@ namespace UnityEngine.UI.Extensions
|
|||
frame = Mathf.FloorToInt(frameProgress * textureSheetAnimation.numTilesX);
|
||||
|
||||
int row = textureSheetAnimation.rowIndex;
|
||||
// if (textureSheetAnimation.useRandomRow) { // FIXME - is this handled internally by rowIndex?
|
||||
// row = Random.Range(0, textureSheetAnimation.numTilesY, using: particle.randomSeed);
|
||||
// }
|
||||
if (textureSheetAnimation.rowMode == ParticleSystemAnimationRowMode.Random)
|
||||
{ // FIXME - is this handled internally by rowIndex?
|
||||
row = Mathf.Abs((int)particle.randomSeed % textureSheetAnimation.numTilesY);
|
||||
}
|
||||
frame += row * textureSheetAnimation.numTilesX;
|
||||
break;
|
||||
|
||||
|
@ -234,7 +235,7 @@ namespace UnityEngine.UI.Extensions
|
|||
frame %= textureSheetAnimationFrames;
|
||||
|
||||
particleUV.x = (frame % textureSheetAnimation.numTilesX) * textureSheetAnimationFrameSize.x;
|
||||
particleUV.y = 1.0f - Mathf.FloorToInt(frame / textureSheetAnimation.numTilesX) * textureSheetAnimationFrameSize.y;
|
||||
particleUV.y = 1.0f - ((frame / textureSheetAnimation.numTilesX) + 1) * textureSheetAnimationFrameSize.y;
|
||||
particleUV.z = particleUV.x + textureSheetAnimationFrameSize.x;
|
||||
particleUV.w = particleUV.y + textureSheetAnimationFrameSize.y;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue