Beispiel #1
0
 private void GraspingObjectStateHandler()
 {
     if (!isEnabled)
     {
         ChangeState(MarkHandState.Deactivating);
     }
     else if (interactionHand.graspedObject == null)
     {
         // Destroy the object at base hand's location
         baseHandObject.Destroy();
         baseHandObject = null;
         markHandObject = null;
         ownership      = Ownership.None;
         ChangeState(MarkHandState.Idle);
     }
 }
Beispiel #2
0
    // Hacky, basically this one waits for the fading to be completed
    // and then handles everything else.
    IEnumerator HandFadeOut()
    {
        // Fade out the hand
        Color transparent = new Color(0, 0, 0, 0f);
        Tween tween       = HandModel.materials[1].DOColor(transparent, "_BaseColor", 0.8f).SetOptions(true);

        yield return(tween.WaitForCompletion());

        /* Fading finished */
        // If marked hand is grasping an object destroy it
        if (markHandObject != null)
        {
            // Transfer ownership first
            if (ownership == Ownership.MarkHand)
            {
                markHandObject.TransferOwnership();
            }
            markHandObject.Destroy();
        }
        baseHandObject = null;
        LeapProvider.EnableHand(false, HandChirality);
        handFadeOutCoroutine = null;
        ChangeState(MarkHandState.Disabled);
    }