using System.Collections.Generic; using Unity.Mathematics; using UnityEngine; namespace RebootReality.jelycho.InfectedArea { public class InfectedAreaInfo { public float3 Center; public float Radius; public ParticleSystem ParticleSystem; } public class InfectedAreaManager : MonoBehaviour { [SerializeField] ParticleSystem m_ParticlesPrefab; public readonly List InfectedAreas = new List(); public void Add(float3 center, float radius) { ParticleSystem ps = Instantiate(m_ParticlesPrefab, center, Quaternion.identity); ParticleSystem.ShapeModule shapeModule = ps.shape; shapeModule.radius = radius; ps.Play(); InfectedAreaInfo info = new InfectedAreaInfo { Center = center, Radius = radius, ParticleSystem = ps }; InfectedAreas.Add(info); } } }