2026-04-24 캐릭터 상호작용
This commit is contained in:
19
Assets/02_Scripts/Interact/DialogInteractable.cs
Normal file
19
Assets/02_Scripts/Interact/DialogInteractable.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
[RequireComponent(typeof(DialogPlayer))]
|
||||
public class DialogInteractable : MonoBehaviour
|
||||
{
|
||||
private DialogPlayer _player;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_player = GetComponent<DialogPlayer>();
|
||||
}
|
||||
|
||||
public void HandleActivated(ActivateEventArgs args)
|
||||
{
|
||||
if (_player == null || _player.IsPlaying) return;
|
||||
_ = _player.Play();
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/Interact/DialogInteractable.cs.meta
Normal file
2
Assets/02_Scripts/Interact/DialogInteractable.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a8a22189f0d1e5448bf3e44657410176
|
||||
Reference in New Issue
Block a user