Пример #1
0
 private bool TryGetTarget(XRRayInteractor interactor, out GrabTarget target)
 {
     if (interactor.GetCurrentRaycastHit(out var hit))
     {
         if (hit.transform.TryGetComponent(out Rigidbody rigidbody))
         {
             target = new GrabTarget(rigidbody, hit.transform.GetComponent <Collider>());
             return(true);
         }
     }
     target = new GrabTarget();
     return(false);
 }
Пример #2
0
 private void Awake()
 {
     m_target = new GrabTarget();
 }