rabidus-test/Assets/VFXController.cs

24 lines
513 B
C#
Raw Normal View History

2023-11-08 16:21:39 +03:00
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;
}
}