44 lines
768 B
C#
44 lines
768 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering.PostProcessing;
|
|
using UnityEngine.TextCore.Text;
|
|
using UnityEngine.UI;
|
|
|
|
public class VFX_manager : MonoBehaviour
|
|
{
|
|
[SerializeField] List<GameObject> effectObjects;
|
|
List<IEffect> effects;
|
|
|
|
void Start()
|
|
{
|
|
effects = new List<IEffect>();
|
|
foreach (var effectObject in effectObjects)
|
|
{
|
|
effects.Add(effectObject.GetComponent<IEffect>());
|
|
}
|
|
//effectObjects.Clear();
|
|
}
|
|
|
|
public void PlayEffect(Character character)
|
|
{
|
|
effects[character.CharacterIndex].Play();
|
|
}
|
|
|
|
public void PlayEffect(int index)
|
|
{
|
|
effects[index].Play();
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|