2026-04-08 스킬시스템 진행중, 폴더구조 변경등
This commit is contained in:
90
Assets/06_Skills/VFX/Zyncope/scripts/MagicCircleManager.cs
Normal file
90
Assets/06_Skills/VFX/Zyncope/scripts/MagicCircleManager.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZyncopeVFXMagicCircleManager
|
||||
{
|
||||
public class MagicCircleManager : MonoBehaviour
|
||||
{
|
||||
[HideInInspector] public Transform vfxDisplayLoc1, vfxDisplayLoc2;
|
||||
|
||||
[HideInInspector] public List<GameObject> magicCircleInstant = new List<GameObject>();
|
||||
[HideInInspector] public List<GameObject> magicCircleLooping = new List<GameObject>();
|
||||
|
||||
List<GameObject> sceneMagicCircleInstant = new List<GameObject>();
|
||||
List<GameObject> sceneMagicCircleLooping = new List<GameObject>();
|
||||
int currentVFX = 0;
|
||||
//[HideInInspector] public Text currentVFXName;
|
||||
public bool autoplayVFX;
|
||||
float repeatVal = 7;
|
||||
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
for (int x = 0; x < magicCircleInstant.Count; x++)
|
||||
{
|
||||
GameObject vfxObject1 = Instantiate(magicCircleInstant[x], vfxDisplayLoc1);
|
||||
vfxObject1.SetActive(false);
|
||||
sceneMagicCircleInstant.Add(vfxObject1);
|
||||
|
||||
|
||||
GameObject vfxObject2 = Instantiate(magicCircleLooping[x], vfxDisplayLoc2);
|
||||
vfxObject2.SetActive(false);
|
||||
sceneMagicCircleLooping.Add(vfxObject2);
|
||||
}
|
||||
DisplayCurrentVFXName();
|
||||
PlayVFXAgain();
|
||||
if (autoplayVFX)
|
||||
{
|
||||
InvokeRepeating("NextVFX", repeatVal, repeatVal);
|
||||
}
|
||||
}
|
||||
|
||||
public void NextVFX()
|
||||
{
|
||||
HideVFX();
|
||||
currentVFX += 1;
|
||||
if (currentVFX >= magicCircleInstant.Count)
|
||||
currentVFX = 0;
|
||||
DisplayVFX();
|
||||
DisplayCurrentVFXName();
|
||||
}
|
||||
|
||||
public void PreviousVFX()
|
||||
{
|
||||
HideVFX();
|
||||
currentVFX -= 1;
|
||||
if (currentVFX < 0)
|
||||
currentVFX = magicCircleInstant.Count - 1;
|
||||
DisplayVFX();
|
||||
DisplayCurrentVFXName();
|
||||
}
|
||||
|
||||
public void PlayVFXAgain()
|
||||
{
|
||||
HideVFX();
|
||||
DisplayVFX();
|
||||
}
|
||||
|
||||
void HideVFX()
|
||||
{
|
||||
sceneMagicCircleInstant[currentVFX].SetActive(false);
|
||||
sceneMagicCircleLooping[currentVFX].SetActive(false);
|
||||
}
|
||||
|
||||
void DisplayVFX()
|
||||
{
|
||||
sceneMagicCircleInstant[currentVFX].SetActive(true);
|
||||
sceneMagicCircleLooping[currentVFX].SetActive(true);
|
||||
}
|
||||
|
||||
void DisplayCurrentVFXName()
|
||||
{
|
||||
string[] displayNameSplit = sceneMagicCircleInstant[currentVFX].name.Split("_");
|
||||
string removeUnused = displayNameSplit[3].Replace("(Clone)", "");
|
||||
string capitalizedString = char.ToUpper(removeUnused[0]) + removeUnused.Substring(1) + " Magic Circle";
|
||||
string displayVFXName = capitalizedString;
|
||||
//currentVFXName.text = displayVFXName;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user