0728
This commit is contained in:
23
Assets/02_Scripts/Story/ch3/KimchiHitZone.cs
Normal file
23
Assets/02_Scripts/Story/ch3/KimchiHitZone.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class KimchiHitZone : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private UnityEvent onKimchiHit;
|
||||
|
||||
private bool hasBeenHit;
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (hasBeenHit)
|
||||
return;
|
||||
|
||||
if (!other.CompareTag("Kimchi"))
|
||||
return;
|
||||
|
||||
hasBeenHit = true;
|
||||
onKimchiHit?.Invoke();
|
||||
|
||||
Debug.Log("김치싸대기 성공!");
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/Story/ch3/KimchiHitZone.cs.meta
Normal file
2
Assets/02_Scripts/Story/ch3/KimchiHitZone.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f38e3e49c2637c84f9681eddb0eb1a47
|
||||
22
Assets/02_Scripts/Story/ch3/ResetChildLocalRotation.cs
Normal file
22
Assets/02_Scripts/Story/ch3/ResetChildLocalRotation.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class ResetChildLocalRotation : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Transform target;
|
||||
|
||||
private Quaternion initialLocalRotation;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (target != null)
|
||||
initialLocalRotation = target.localRotation;
|
||||
}
|
||||
|
||||
public void ResetRotation()
|
||||
{
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
target.localRotation = initialLocalRotation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f701eb628e084b4f87b750c2716f6f5
|
||||
Reference in New Issue
Block a user