rabidus-test/Assets/VFXController.cs

24 lines
513 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VFXController : MonoBehaviour
{
[SerializeField] private Transform _point;
[SerializeField] private GameObject _vfx;
public void ShowVFX(Transform parent)
{
_vfx.SetActive(true);
_point.transform.parent = parent;
_point.transform.localPosition = Vector3.zero;
}
public void HideVFX()
{
_vfx.SetActive(false);
_point.transform.parent = null;
}
}