제페토 파티클 추가
This commit is contained in:
@@ -5,23 +5,37 @@ public class ZepettoTrigger : MonoBehaviour
|
||||
{
|
||||
public VisualEffect vfx;
|
||||
public Animator zepettoAnimator;
|
||||
public string animationName;
|
||||
|
||||
// Trigger À̸§ (Walk, Wave, Hug)
|
||||
public string triggerName;
|
||||
|
||||
public float delayBeforeVFX;
|
||||
|
||||
private bool hasPlayed = false;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
vfx.Stop();
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (hasPlayed) return;
|
||||
if (!other.CompareTag("Player")) return;
|
||||
|
||||
hasPlayed = true;
|
||||
zepettoAnimator.Play(animationName);
|
||||
Invoke("PlayVFX", delayBeforeVFX);
|
||||
|
||||
Debug.Log("Player Triggered!");
|
||||
|
||||
// Animator Trigger ½ÇÇà
|
||||
zepettoAnimator.SetTrigger(triggerName);
|
||||
|
||||
Invoke(nameof(PlayVFX), delayBeforeVFX);
|
||||
}
|
||||
|
||||
private void PlayVFX()
|
||||
{
|
||||
vfx.SendEvent("OnPlay");
|
||||
vfx.Reinit();
|
||||
vfx.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user