Files
beyond/Assets/ThirdParty/Procedural Worlds/Gaia/Gaia Pro/Scripts/Utils/FloatingPointFixParticleSystem.cs
2024-11-20 15:21:28 +01:00

45 lines
1.1 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if GAIA_PRO_PRESENT
namespace Gaia
{
[RequireComponent(typeof(ParticleSystem))]
public class FloatingPointFixParticleSystem : FloatingPointFixMember
{
protected new void OnEnable()
{
ParticleSystem ps = GetComponent<ParticleSystem>();
//Register as Particle system
if (ps && ps.main.simulationSpace == ParticleSystemSimulationSpace.World)
FloatingPointFix.Instance.AddWorldSpaceParticleSystem(ps);
}
protected new void OnDestroy()
{
if (FloatingPointFix.IsActive)
{
ParticleSystem ps = GetComponent<ParticleSystem>();
if (ps)
FloatingPointFix.Instance.RemoveWorldSpaceParticleSystem(ps);
}
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
}
#endif