public void SetObject() { XRBaseInteractable obj = transform.Find("AttachPoint").GetComponent <XRSocketInteractor>().selectTarget; raygunObject = obj.GetComponent <RaygunObject>(); raygunObjectType = raygunObject.raygunObjectType; }
public void OnTriggerExit(Collider other) { if (other == raygunObject) { raygunObject.gameObject.AddComponent <Rigidbody>(); raygunObject.transform.parent = null; raygunObject = null; } }
private void OnTriggerEnter(Collider other) { if (other.tag == "Raygunobject") { if (!GetComponent <XRGrabInteractable>().isSelected) { Debug.Log(other.gameObject.name, other.gameObject); Destroy(other.GetComponent <Rigidbody>()); other.transform.parent = transform.Find("AttachPoint"); other.transform.position = transform.Find("AttachPoint").transform.position; raygunObject = other.GetComponent <RaygunObject>(); } } }
public void UnsetObject() { raygunObject = null; raygunObjectType = ""; }