virtual public void Create(Leap.Unity.Interaction.InteractionManager interactionManager, PinchDetector leftPinchDetector, PinchDetector rightPinchDetector)
        {
            _velocityFrames                 = new Vector3[ObjectManager.Instance.CreationForceWindowSize];
            _creating                       = true;
            LeapRTSComponent.AllowScale     = !OverrideLeapRTSScaling;
            LeapRTSComponent.enabled        = true;
            LeapRTSComponent.PinchDetectorA = leftPinchDetector;
            LeapRTSComponent.PinchDetectorB = rightPinchDetector;

            LeapInteractionBehaviour.enabled = false;
            LeapInteractionBehaviour.Manager = interactionManager;

            // Turn off Collider and Rigidbody components to disable physics
            EnableCollidersAndRigidbodies(false);

            // Turn off materialized meshes
            EnableMaterializedMeshes(false);

            // Turn on outline meshes
            EnableOutlineMeshes(true);
            IlluminateOutlineBloom();

            // Enable looping and play the creation sound effect
            EffectAudioSource.loop = true;
            EffectAudioSource.clip = AudioManager.Instance.GetAudioClip(GameAudioClipType.INTERACTABLE_OBJECT_CREATING);
            EffectAudioSource.Play();
        }
示例#2
0
 public void Settings(GameObject controller, Leap.Unity.Interaction.InteractionManager manager, string type, string levels)
 {
     HandController = controller;
     Manager        = manager;
     Type           = type;
     Levels         = levels;
     highlightGrasp = transform.GetComponent <MeshRenderer>().materials[2];
 }
    protected override void OnEnable() {
      base.OnEnable();

      if (targets.Length == 1) {
        _interactionBehaviour = target as InteractionBehaviourBase;
        _manager = _interactionBehaviour.GetComponentInParent<InteractionManager>();
        if (_manager == null) {
          _manager = FindObjectOfType<InteractionManager>();
        }
      } else {
        _interactionBehaviour = null;
      }

      if (PrefabUtility.GetPrefabType((target as Component).gameObject) != PrefabType.Prefab) {
        specifyCustomDecorator("_manager", managerDectorator);
      }
    }
示例#4
0
        private void Awake()
        {
            interactionManager = Leap.Unity.Interaction.InteractionManager.instance;

            if (interactionManager)
            {
                foreach (InteractionController controller in interactionManager.interactionControllers)
                {
                    if (controller is InteractionHand)
                    {
                        InteractionHand hand = (InteractionHand)controller;

                        if (hand.isLeft)
                        {
                            leftInteractionHand = hand;
                        }
                        else
                        {
                            rightInteractionHand = hand;
                        }

                        hand.leapProvider = defaultProvider;
                    }
                    else if (controller is SteamVRInteractionController)
                    {
                        SteamVRInteractionController interactionController = (SteamVRInteractionController)controller;

                        if (interactionController.isLeft)
                        {
                            leftInteractionController = interactionController;
                        }
                        else
                        {
                            rightInteractionController = interactionController;
                        }
                    }
                }
            }

            SkeletalControllerHand[] hands = transform.parent.GetComponentsInChildren <SkeletalControllerHand>(true);
            leftSkeletalControllerHand  = hands.First(item => item.IsLeft);
            rightSkeletalControllerHand = hands.First(item => !item.IsLeft);
        }
示例#5
0
        private void Awake()
        {
            platformManager    = GetComponent <PlatformManager>();
            interactionManager = Leap.Unity.Interaction.InteractionManager.instance;
            if (interactionManager != null)
            {
                controllerManager = interactionManager.GetComponent <PlatformControllerManager>();
            }

            DataHand[] dataHands = modelManager.GetComponentsInChildren <DataHand>(true);

            leftAbstractHand  = (HandModelBase)dataHands.First(item => item is DataHand && item.Handedness == Chirality.Left);
            rightAbstractHand = (HandModelBase)dataHands.First(item => item is DataHand && item.Handedness == Chirality.Right);

            if (interactionManager)
            {
                foreach (InteractionController controller in interactionManager.interactionControllers)
                {
                    if (controller is InteractionHand)
                    {
                        InteractionHand hand = (InteractionHand)controller;

                        if (hand.isLeft)
                        {
                            leftInteractionHand = hand;
                        }
                        else
                        {
                            rightInteractionHand = hand;
                        }

                        hand.leapProvider = defaultProvider;
                    }
                }
            }

            SkeletalControllerHand[] hands = transform.parent.GetComponentsInChildren <SkeletalControllerHand>(true);
            leftSkeletalControllerHand  = hands.First(item => item.IsLeft);
            rightSkeletalControllerHand = hands.First(item => !item.IsLeft);
        }
示例#6
0
        private void Awake()
        {
            userRig            = GetComponentInParent <UserRig>();
            platformManager    = GetComponent <PlatformManager>();
            interactionManager = Leap.Unity.Interaction.InteractionManager.instance;
            if (interactionManager != null)
            {
                controllerManager = interactionManager.GetComponent <PlatformControllerManager>();
            }

            if (interactionManager)
            {
                foreach (InteractionController controller in interactionManager.interactionControllers)
                {
                    if (controller is InteractionHand)
                    {
                        InteractionHand hand = (InteractionHand)controller;

                        if (hand.isLeft)
                        {
                            leftInteractionHand = hand;
                        }
                        else
                        {
                            rightInteractionHand = hand;
                        }

                        hand.leapProvider = defaultProvider;
                    }
                }
            }

            SkeletalControllerHand[] hands = transform.parent.GetComponentsInChildren <SkeletalControllerHand>(true);
            leftSkeletalControllerHand  = hands.First(item => item.IsLeft);
            rightSkeletalControllerHand = hands.First(item => !item.IsLeft);
        }
示例#7
0
 public RigidbodyWarper(InteractionManager manager, Transform transform, Rigidbody rigidbody, float returnTime) {
   _manager = manager;
   _transform = transform;
   _rigidbody = rigidbody;
   _returnTime = returnTime;
 }