저장
This commit is contained in:
BIN
Assets/01_Scenes/MazeRoom.unity
LFS
BIN
Assets/01_Scenes/MazeRoom.unity
LFS
Binary file not shown.
27
Assets/02_Scripts/MazeRoom/zepettoTrigger.cs
Normal file
27
Assets/02_Scripts/MazeRoom/zepettoTrigger.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/MazeRoom/zepettoTrigger.cs.meta
Normal file
2
Assets/02_Scripts/MazeRoom/zepettoTrigger.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0b9356ed1cc2c746a48ea28d0537dc8
|
||||
Reference in New Issue
Block a user