コード例 #1
0
        /// <summary>Function for controller trigger unpressed</summary>
        public void Release()
        {
            //Do the holding object calls and sets
            if (holdingObj != null)
            {
                if (holdingObj.GetComponent <GrabLock>())
                {
                    return;
                }
                OnBeforeReleased?.Invoke(this, holdingObj);

                if (squeezing)
                {
                    holdingObj.OnUnsqueeze(this);
                }
                holdingObj.OnRelease(this, true);
                OnReleased?.Invoke(this, holdingObj);
            }
            BreakGrabConnection();
        }
コード例 #2
0
 /// <summary>Event for controller ungrip</summary>
 public void Unsqueeze()
 {
     squeezing = false;
     OnUnsqueezed?.Invoke(this, holdingObj);
     holdingObj?.OnUnsqueeze(this);
 }