예제 #1
0
        public bool TryGrab()
        {
            // Already holding something
            if (HeldGrabbable != null)
            {
                return(false);
            }

            // Activate Nearby Grabbable
            if (grabsInTrigger.ClosestGrabbable != null)
            {
                GrabGrabbable(grabsInTrigger.ClosestGrabbable);

                return(true);
            }
            // If no immediate grabbable, see if remote is available to pull
            else if (grabsInTrigger.ClosestRemoteGrabbable != null && flyingGrabbable == null)
            {
                flyingGrabbable = grabsInTrigger.ClosestRemoteGrabbable;
                flyingGrabbable.GrabRemoteItem(this);
            }

            return(false);
        }