You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
@@ -1,16 +1,21 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Coffee.UIParticleInternal;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using UnityEngine;
|
||||||
using UnityEngine.TestTools;
|
using UnityEngine.TestTools;
|
||||||
|
|
||||||
namespace Coffee.UIParticle.Editor.Tests
|
namespace Coffee.UIParticle.Editor.Tests
|
||||||
{
|
{
|
||||||
public class NewTestScript
|
public class NewTestScript
|
||||||
{
|
{
|
||||||
// A Test behaves as an ordinary method
|
[TestCase(-1)]
|
||||||
[Test]
|
[TestCase(0)]
|
||||||
public void NewTestScriptSimplePasses()
|
[TestCase(2048)]
|
||||||
|
[TestCase(3000)]
|
||||||
|
public void GetParticleArray(int requiredSize)
|
||||||
{
|
{
|
||||||
// Use the Assert class to test conditions
|
var array = ParticleSystemExtensions.GetParticleArray(requiredSize);
|
||||||
|
Debug.Log($"requiredSize: {requiredSize}, array.Length: {array.Length}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
|
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ using UnityEngine.UI;
|
|||||||
using Random = UnityEngine.Random;
|
using Random = UnityEngine.Random;
|
||||||
|
|
||||||
[assembly: InternalsVisibleTo("Coffee.UIParticle.Editor")]
|
[assembly: InternalsVisibleTo("Coffee.UIParticle.Editor")]
|
||||||
|
[assembly: InternalsVisibleTo("Coffee.UIParticle.Editor.Tests")]
|
||||||
[assembly: InternalsVisibleTo("Coffee.UIParticle.PerformanceDemo")]
|
[assembly: InternalsVisibleTo("Coffee.UIParticle.PerformanceDemo")]
|
||||||
[assembly: InternalsVisibleTo("Coffee.UIParticle.Demo")]
|
[assembly: InternalsVisibleTo("Coffee.UIParticle.Demo")]
|
||||||
|
|
||||||
|
|||||||
@@ -12,12 +12,8 @@ namespace Coffee.UIParticleInternal
|
|||||||
public static ParticleSystem.Particle[] GetParticleArray(int size)
|
public static ParticleSystem.Particle[] GetParticleArray(int size)
|
||||||
{
|
{
|
||||||
if (s_TmpParticles.Length < size)
|
if (s_TmpParticles.Length < size)
|
||||||
{
|
|
||||||
while (s_TmpParticles.Length < size)
|
|
||||||
{
|
{
|
||||||
size = Mathf.NextPowerOfTwo(size);
|
size = Mathf.NextPowerOfTwo(size);
|
||||||
}
|
|
||||||
|
|
||||||
s_TmpParticles = new ParticleSystem.Particle[size];
|
s_TmpParticles = new ParticleSystem.Particle[size];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user