29 lines
705 B
C#
29 lines
705 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
namespace BITKit
|
|
{
|
|
public class VFXPlayer : MonoBehaviour, IAction
|
|
{
|
|
public Optional<ParticleSystem[]> allowParticles;
|
|
public Optional<Light> allowLight;
|
|
public void Execute()
|
|
{
|
|
if(allowParticles.Allow)
|
|
{
|
|
foreach (var particle in allowParticles.Value)
|
|
{
|
|
particle.time = 0;
|
|
particle.Play(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#if UNITY_EDITOR
|
|
[UnityEditor.CustomEditor(typeof(VFXPlayer))]
|
|
public class VFXPlayerInspector:BITInspector<VFXPlayer>
|
|
{
|
|
|
|
}
|
|
#endif
|
|
} |