File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 11using System . Collections ;
2+ using Coffee . UIParticleInternal ;
23using NUnit . Framework ;
4+ using UnityEngine ;
35using UnityEngine . TestTools ;
46
57namespace Coffee . UIParticle . Editor . Tests
68{
79 public class NewTestScript
810 {
9- // A Test behaves as an ordinary method
10- [ Test ]
11- public void NewTestScriptSimplePasses ( )
11+ [ TestCase ( - 1 ) ]
12+ [ TestCase ( 0 ) ]
13+ [ TestCase ( 2048 ) ]
14+ [ TestCase ( 3000 ) ]
15+ public void GetParticleArray ( int requiredSize )
1216 {
13- // Use the Assert class to test conditions
17+ var array = ParticleSystemExtensions . GetParticleArray ( requiredSize ) ;
18+ Debug . Log ( $ "requiredSize: { requiredSize } , array.Length: { array . Length } ") ;
1419 }
1520
1621 // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
Original file line number Diff line number Diff line change 99using Random = UnityEngine . Random ;
1010
1111[ assembly: InternalsVisibleTo ( "Coffee.UIParticle.Editor" ) ]
12+ [ assembly: InternalsVisibleTo ( "Coffee.UIParticle.Editor.Tests" ) ]
1213[ assembly: InternalsVisibleTo ( "Coffee.UIParticle.PerformanceDemo" ) ]
1314[ assembly: InternalsVisibleTo ( "Coffee.UIParticle.Demo" ) ]
1415
Original file line number Diff line number Diff line change @@ -13,11 +13,7 @@ public static ParticleSystem.Particle[] GetParticleArray(int size)
1313 {
1414 if ( s_TmpParticles . Length < size )
1515 {
16- while ( s_TmpParticles . Length < size )
17- {
18- size = Mathf . NextPowerOfTwo ( size ) ;
19- }
20-
16+ size = Mathf . NextPowerOfTwo ( size ) ;
2117 s_TmpParticles = new ParticleSystem . Particle [ size ] ;
2218 }
2319
You can’t perform that action at this time.
0 commit comments