Ejemplo n.º 1
0
    public void SetObject()
    {
        XRBaseInteractable obj = transform.Find("AttachPoint").GetComponent <XRSocketInteractor>().selectTarget;

        raygunObject     = obj.GetComponent <RaygunObject>();
        raygunObjectType = raygunObject.raygunObjectType;
    }
Ejemplo n.º 2
0
 public void OnTriggerExit(Collider other)
 {
     if (other == raygunObject)
     {
         raygunObject.gameObject.AddComponent <Rigidbody>();
         raygunObject.transform.parent = null;
         raygunObject = null;
     }
 }
Ejemplo n.º 3
0
    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>();
            }
        }
    }
Ejemplo n.º 4
0
 public void UnsetObject()
 {
     raygunObject     = null;
     raygunObjectType = "";
 }