ProjectDDD/Assets/External/Free Slash VFX/Demo/Scripts/ParticleAnimationEvent.cs

28 lines
651 B
C#
Raw Normal View History

2025-08-20 06:28:04 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MaykerStudio.Demo
{
public class ParticleAnimationEvent : MonoBehaviour
{
[SerializeField]
private Transform particleContainer;
public void PlayParticle()
{
ParticleSystem particleSystem = GetComponentInChildren<ParticleSystem>();
if (particleSystem && !particleSystem.GetComponent<Projectile>())
{
particleSystem.Play(true);
}
else
{
AttackerController.Instance.SpawnProjectile();
}
}
}
}