mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 11:45:09 +00:00
22 lines
693 B
C#
22 lines
693 B
C#
|
using UnityEngine;
|
||
|
|
||
|
namespace HeavenStudio.Util
|
||
|
{
|
||
|
public static class ParticleSystemHelpers
|
||
|
{
|
||
|
public static void PlayScaledAsync(this ParticleSystem particleSystem, float timeScale)
|
||
|
{
|
||
|
ParticleSystem.MainModule main = particleSystem.main;
|
||
|
main.simulationSpeed = (1 / Conductor.instance.pitchedSecPerBeat) * timeScale;
|
||
|
particleSystem.Play();
|
||
|
}
|
||
|
|
||
|
public static void SetAsyncScaling(this ParticleSystem particleSystem, float timeScale)
|
||
|
{
|
||
|
ParticleSystem.MainModule main = particleSystem.main;
|
||
|
main.simulationSpeed = (1 / Conductor.instance.pitchedSecPerBeat) * timeScale;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|