mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-12-02 22:37:28 +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;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|