コード例 #1
0
        public virtual void Ungrab(Grabber.GrabInfo grabberInfo)
        {
            var  matches            = grabbers.Where(grabber => grabber.info == grabberInfo);
            bool isCurrentlyGrabber = matches.Count() > 0;

            if (isCurrentlyGrabber)
            {
                Ungrab(matches.First());
            }
        }
コード例 #2
0
        public virtual LocalInfo CreateLocalInfo(Grabber.GrabInfo grabInfo, float maxForce)
        {
            var localInfo = new LocalInfo()
            {
                info          = grabInfo,
                localPosition = grabInfo.parent.InverseTransformPoint(transform.position),
                localRotation = grabInfo.parent.InverseTransformRotation(transform.rotation),
                maxForce      = maxForce
            };

            return(localInfo);
        }
コード例 #3
0
        public virtual bool GetLocalInfo(Grabber.GrabInfo grabInfo, out LocalInfo localInfo)
        {
            var  matches            = grabbers.Where(grabber => grabber.info == grabInfo);
            bool isCurrentlyGrabber = matches.Count() > 0;

            if (isCurrentlyGrabber)
            {
                localInfo = matches.First();
            }
            else
            {
                localInfo = default;
            }

            return(isCurrentlyGrabber);
        }
コード例 #4
0
 public virtual void Grab(Grabber.GrabInfo grabberInfo, float maxForce)
 {
     Grab(CreateLocalInfo(grabberInfo, maxForce));
 }