1
This commit is contained in:
29
Unity/Scripts/VFXManager/VFXPlayer.cs
Normal file
29
Unity/Scripts/VFXManager/VFXPlayer.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
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 Excute()
|
||||
{
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user