2026-04-24 캐릭터 상호작용

This commit is contained in:
2026-04-24 17:46:29 +09:00
parent 305a911524
commit 752b891a48
6 changed files with 51 additions and 21 deletions

View 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();
}
}