using System.Collections; using System.Collections.Generic; using UnityEngine; namespace TcgEngine.FX { /// /// FX that snap to another object (target), and follows it /// public class SnapFX : MonoBehaviour { public Transform target; public Vector3 offset = Vector3.zero; void Start() { } void Update() { if (target == null) { Destroy(gameObject); return; } transform.position = target.position + offset; } } }