third person teleporting, grab interactables

This commit is contained in:
HelarJ
2022-03-14 14:21:24 +02:00
parent 813cd0c451
commit 98dac07345
131 changed files with 16809 additions and 1781 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
[Serializable]
[RequireComponent(typeof(XRSocketInteractor))]
public class Inventory : MonoBehaviour
{
public int slots = 1;
private List<int> _inv;
private XRSocketInteractor xrSocketInteractor;
private void Awake()
{
xrSocketInteractor = GetComponent<XRSocketInteractor>();
_inv = new List<int>(slots);
var oldestInteractableSelected = xrSocketInteractor.GetOldestInteractableSelected();
xrSocketInteractor.selectEntered.AddListener(Call);
xrSocketInteractor.hoverEntered.AddListener(Call);
}
private void Call(HoverEnterEventArgs arg0)
{
Debug.Log("hoverenter "+arg0.interactableObject + " " + xrSocketInteractor.hasHover + " " + xrSocketInteractor.hasSelection);
}
private void Call(SelectEnterEventArgs arg0)
{
Debug.Log("selectenter "+arg0.interactableObject);
}
}