Merge branch 'main' of https://www.nakjungit.site/sharedacc520k/WhaleAdventure_VR
# Conflicts: # Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity
This commit is contained in:
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
|
||||
@@ -8,4 +8,5 @@ public enum Zone
|
||||
Seaside,
|
||||
BlackjackGame,
|
||||
BlackBgm,
|
||||
MazeRoomSound
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user