Exemple #1
0
        internal void OnGrabTriggerEnter(GrabCollider notifier, bool isLeft)
        {
            // already waiting for grabbing. It's inavailable.
            if (IsReadyForGrab)
            {
                return;
            }

            Debug.Log("Grabable:On Grab Trigger Enter");
            m_isLeftHanded = isLeft;
            Grab.Instance.WaitForGrabbing(this);

            m_grabColliders.Add(notifier);

            /*
             * if (GlobalLogIO.m_timeManager != null) {
             *  string currHand = null;
             *
             *  if(m_isLeftHanded) {
             *      currHand = "Left";
             *  } else {
             *      currHand = "Right";
             *  }
             *  Debug.Log("-----------NEWWWWWW Grabable:On Grab Trigger Enter");
             * // GlobalLogIO.appendWhateverToFile(GlobalLogIO.fileName, currHand, "enter", this.gameObject.name, GlobalLogIO.m_timeManager.getCurrentTime());
             * }
             */
            // Trigger vibration if it's available
            if (Grab.Instance.UseVibration)
            {
                Vibration.Vibrate(25);
            }

            m_isReadyForGrab = true;
        }
 // OnStateExit is called when a transition ends and the state machine finishes evaluating this state
 override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     Debug.Log("____exiting selection tool");
     FoamUtils.IsGlobalGrabbing = false;
     if (_data.CurrentSelectionObj)
     {
         Portalble.Functions.Grab.GrabCollider curGC = _data.CurrentSelectionObj.transform.GetChild(0).GetComponent <Portalble.Functions.Grab.GrabCollider>();
         if (curGC)
         {
             Debug.Log("____exiting selection tool degrabbed");
             curGC.DeGrab();
         }
     }
 }