// Stop the interaction
        public bool Stop()
        {
            if (!inInteraction)
            {
                return(false);
            }

            bool pickUp = false;
            bool pause  = false;

            TriggerUntriggeredEvents(false, out pickUp, out pause);

            if (interactionSystem.OnInteractionStop != null)
            {
                interactionSystem.OnInteractionStop(effectorType, interactionObject);
            }

            // Reset the interaction target
            if (interactionTarget != null)
            {
                interactionTarget.ResetRotation();
            }

            // Reset the internal values
            interactionObject = null;
            weight            = 0f;
            timer             = 0f;

            isPaused   = false;
            target     = null;
            defaults   = false;
            resetTimer = 1f;
            if (poser != null && !pickedUp)
            {
                poser.weight = 0f;
            }
            pickedUp = false;
            started  = false;

            return(true);
        }
Exemple #2
0
        // Stop the interaction
        public void Stop()
        {
            if (!inInteraction)
            {
                return;
            }

            if (OnStop != null)
            {
                OnStop(effectorType, interactionObject);
            }

            // Reset the interaction target
            if (interactionTarget != null)
            {
                interactionTarget.ResetRotation();
            }

            // End event for the interaction object
            interactionObject.EndInteraction(effector.bone);

            // Reset the internal values
            interactionObject = null;
            weight            = 0f;
            timer             = 0f;
            pickedUp          = false;
            triggered         = false;
            released          = false;
            isPaused          = false;
            target            = null;
            defaults          = false;
            resetTimer        = 1f;
            if (poser != null)
            {
                poser.weight = 0f;
            }
        }