Files
WhaleAdventure_VR/Assets/02_Scripts/MazeRoom/zepettoTrigger.cs
HIHIHIHIHIHIzz e522e8f74b 저장
2026-06-25 16:37:27 +09:00

28 lines
579 B
C#

using UnityEngine;
using UnityEngine.VFX;
public class zepe : MonoBehaviour
{
public VisualEffect vfx;
public Animator zepettoAnimator;
public string animationName;
public float delayBeforeVFX;
private bool hasPlayed = false;
private void OnTriggerEnter(Collider other)
{
if (hasPlayed) return;
if (!other.CompareTag("Player")) return;
hasPlayed = true;
zepettoAnimator.Play(animationName);
Invoke("PlayVFX", delayBeforeVFX);
}
private void PlayVFX()
{
vfx.SendEvent("OnPlay");
}
}