Files
2024-10-29 17:16:17 +01:00

18 lines
594 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
//this script attaches a listener function to a object to keep track of scaling functionallity
public class OBJScaler : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
XRGrabInteractable xRGrabInteractable = GetComponent<XRGrabInteractable>();
xRGrabInteractable.onSelectEntered.AddListener((baseInteractor) => { GameObject.Find("ObjectSpawner").GetComponent<OBJGrabListener>().onGrab(gameObject); });
}
}