This commit is contained in:
CortexCore
2023-06-05 19:57:17 +08:00
parent f05e28ec58
commit 7f2fea821c
6195 changed files with 489001 additions and 636 deletions

View File

@@ -0,0 +1,40 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cysharp.Threading.Tasks;
namespace BITKit
{
public class EffectPlayer : MonoBehaviour
{
[Header(Constant.Header.Settings)]
[SerializeField] float duration;
[Header(Constant.Header.Components)]
[SerializeField] ParticleSystem[] particleSystems;
[SerializeField] Behaviour[] behaviours;
void Start()
{
particleSystems.ForEach(x => x.Stop());
behaviours.ForEach(x => x.enabled = false);
}
public async void Excute()
{
particleSystems.ForEach(x =>
{
x.time = 0;
x.Play(true);
});
behaviours.ForEach(x =>
{
x.enabled = true;
});
await UniTask.Delay(System.TimeSpan.FromSeconds(duration));
if (BehaviourHelper.Actived)
{
behaviours.ForEach(x =>
{
x.enabled = false;
});
}
}
}
}