r2mods/ilspy_dump/ror2_csproj/Particle_SetMinSize.cs

28 lines
535 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
public class Particle_SetMinSize : MonoBehaviour
{
public float minimumPixelCoverage = 2f;
public float defaultMinimumParticleSize;
[SerializeField]
private bool _isEnabled = true;
private void Start()
{
UpdateMinSize();
}
public void SetEnabled(bool isEnabled)
{
_isEnabled = isEnabled;
UpdateMinSize();
}
private void UpdateMinSize()
{
GetComponent<ParticleSystemRenderer>().minParticleSize = (_isEnabled ? (minimumPixelCoverage / (float)Screen.width) : defaultMinimumParticleSize);
}
}