r2mods/ilspy_dump/ror2_csproj/RoR2/ImpactEffect.cs

23 lines
589 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using System;
using UnityEngine;
namespace RoR2;
[RequireComponent(typeof(EffectComponent))]
internal class ImpactEffect : MonoBehaviour
{
public ParticleSystem[] particleSystems = Array.Empty<ParticleSystem>();
private void Start()
{
EffectComponent component = GetComponent<EffectComponent>();
Color color = ((component.effectData != null) ? ((Color)component.effectData.color) : Color.white);
for (int i = 0; i < particleSystems.Length; i++)
{
ParticleSystem.MainModule main = particleSystems[i].main;
main.startColor = color;
particleSystems[i].Play();
}
}
}