19 lines
433 B
C#
19 lines
433 B
C#
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();
|
|
}
|
|
} |