コード例 #1
0
        /// <summary>
        /// Chooses which grab processing to perform on the grab action.
        /// </summary>
        protected virtual void ChooseGrabProcessor()
        {
            bool disablePrecognition = PrecognitionTimer.StartTime.ApproxEquals(0f);

            InstantGrabProcessor.SetActive(disablePrecognition);
            PrecognitionGrabProcessor.SetActive(!disablePrecognition);
        }
コード例 #2
0
 /// <summary>
 /// Processes the given collision data into a grab action based on the given state.
 /// </summary>
 /// <param name="publisher">The collision data to process.</param>
 /// <param name="actionState">The grab state to check against.</param>
 protected virtual void ProcessGrabAction(ActiveCollisionPublisher publisher, bool actionState)
 {
     InstantGrabProcessor.SetActive(false);
     PrecognitionGrabProcessor.SetActive(false);
     if (GrabAction.Value != actionState)
     {
         GrabAction.Receive(actionState);
     }
     if (GrabAction.Value)
     {
         publisher.Publish();
     }
     ChooseGrabProcessor();
 }