Ejemplo n.º 1
0
        protected virtual void OnAttachedToHand(Hand hand)
        {
            if (activateActionSetOnAttach != null)
            {
                if (actionSetPriority != -1)
                {
                    activateActionSetOnAttach.Activate(hand.handType, actionSetPriority, false);
                }
                else
                {
                    activateActionSetOnAttach.Activate(hand.handType);
                }
            }

            if (onAttachedToHand != null)
            {
                onAttachedToHand.Invoke(hand);
            }

            if (skeletonPoser != null && hand.skeleton != null)
            {
                hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime);
            }

            attachedToHand = hand;
        }
Ejemplo n.º 2
0
        void UpdateAnimatorKnuckles()
        {
            SteamVR_Input_Sources inputSource = (controllerHand.IsLeft) ? SteamVR_Input_Sources.LeftHand : SteamVR_Input_Sources.RightHand;

            if (!assistActionset.IsActive())
            {
                assistActionset.Activate(inputSource);
            }

            animator.SetBool(isGrabbedHash, grabGrip.GetState(inputSource));

            faceButtonTouch = (aButtonTouch.GetState(inputSource) || bButtonTouch.GetState(inputSource) ||
                               trackpadTouch.GetState(inputSource));

            isTriggerTouch = triggerTouch.GetState(inputSource);
            isPinching     = faceButtonTouch;
            if (faceButtonTouch)
            {
                pinchThumbHoriz += (trackpadTouch.GetState(inputSource) ? -1 : 1) * Time.deltaTime * 6;
                pinchThumbHoriz  = Mathf.Clamp01(pinchThumbHoriz);
            }

            animator.SetBool(isPinchingHash, isPinching);
            animator.SetFloat(pinchAmtHash, skeletonBehavior.fingerCurls[1]);
            animator.SetFloat(pinchThumbHorizHash, pinchThumbHoriz);

            pinchTweenTime += (isPinching) ? Time.deltaTime : -Time.deltaTime;
            pinchTweenTime  = Mathf.Clamp(pinchTweenTime, 0, pinchTweenDuration);
            pinchTValue     = Mathf.InverseLerp(0, pinchTweenDuration, pinchTweenTime);
            if (skeletonBehavior)
            {
                skeletonBehavior.indexSkeletonBlend = 1 - pinchTValue;
                skeletonBehavior.thumbSkeletonBlend = 1 - pinchTValue;
            }
        }
Ejemplo n.º 3
0
 private void Start()
 {
     activateActionSetOnAttach_Platformer.Activate(SteamVR_Input_Sources.LeftHand);    // 左のコントローラーのplatformerを有効へ
     activateActionSetOnAttach_Platformer.Activate(SteamVR_Input_Sources.RightHand);   // 右のコントローラーのplatformerを有効へ
     activateActionSetOnAttach_Buggy.Activate(SteamVR_Input_Sources.LeftHand);         // 左のコントローラーのbuggyを有効へ
     activateActionSetOnAttach_Buggy.Activate(SteamVR_Input_Sources.RightHand);        // 右のコントローラーのbuggyを有効へ
     activateActionSetOnAttach_Mixedreality.Activate(SteamVR_Input_Sources.LeftHand);  // 左のコントローラーのmixedrealityを有効へ
     activateActionSetOnAttach_Mixedreality.Activate(SteamVR_Input_Sources.RightHand); // 右のコントローラーのmixedrealityを有効へ
 }
Ejemplo n.º 4
0
 //=========================================================================
 void Awake()
 {
     if (actionSet != null)
     {
         actionSet.Activate(hand.handType);
     }
     if (hand == null)
     {
         Debug.LogWarning("Bracelet component does not have reference to a SteamVR Hand component.");
     }
     else
     {
         if (bracelets.ContainsKey(this.hand.handType))
         {
             bracelets[this.hand.handType] = this;
         }
         else
         {
             bracelets.Add(this.hand.handType, this);
         }
         if (this.hand.handType == SteamVR_Input_Sources.LeftHand)
         {
             handedness = Handedness.Left;
         }
         else if (this.hand.handType == SteamVR_Input_Sources.RightHand)
         {
             handedness = Handedness.Right;
         }
     }
 }
Ejemplo n.º 5
0
        protected virtual void OnAttachedToHand(Hand hand)
        {
            GameObject obj = GameObject.Find("Highlighter");

            if (obj != null)
            {
                Destroy(obj);
            }

            if (activateActionSetOnAttach != null)
            {
                activateActionSetOnAttach.Activate(hand.handType);
            }

            if (onAttachedToHand != null)
            {
                onAttachedToHand.Invoke(hand);
            }

            if (skeletonPoser != null && hand.skeleton != null)
            {
                hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime);
            }

            attachedToHand = hand;
        }
Ejemplo n.º 6
0
 private void Start()
 {
     actionSetEnable.Activate();
     this.SelectWithRightHand();
     toggle2 = SteamVR_Actions._default.GrabPinch;
     select2 = SteamVR_Actions._default.GrabGrip;
 }
Ejemplo n.º 7
0
        protected virtual void OnAttachedToHand(Hand hand)
        {
            if (activateActionSetOnAttach != null)
            {
                activateActionSetOnAttach.Activate(hand.handType);
            }

            if (onAttachedToHand != null)
            {
                onAttachedToHand.Invoke(hand);
            }

            if (skeletonPoser != null && hand.skeleton != null)
            {
                hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime);
            }

            // Play if the track isn't already playing
            if (!audioSource.isPlaying)
            {
                if (!isGoalInteractable)
                {
                    // Grab the distraction for the current riddle
                    audioSource.clip = distractionClips[currentPuzzle];
                }
                audioSource.panStereo = Random.Range(-1, 1);
                audioSource.Play();
            }

            attachedToHand = hand;
        }
Ejemplo n.º 8
0
        protected virtual void OnAttachedToHand(Hand hand)
        {
            if (activateActionSetOnAttach != null)
            {
                activateActionSetOnAttach.Activate(hand.handType);
            }

            if (onAttachedToHand != null)
            {
                onAttachedToHand.Invoke(hand);
            }

            if (skeletonPoser != null && hand.skeleton != null)
            {
                hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime);
            }

            /*
             *
             *
             * float handx = hand.transform.position.x;
             * float handy = hand.transform.position.y;
             * float handz = hand.transform.position.z;
             *
             * float newposx = attachedToHand.currentAttachedObject.transform.position.x - handx;
             * float newposy = attachedToHand.currentAttachedObject.transform.position.y - handy;
             * float newposz = attachedToHand.currentAttachedObject.transform.position.z - handz;
             *
             * //attachedToHand.currentAttachedObject.transform.position = new Vector3(handx, handy, handz);
             */

            attachedToHand = hand;
        }
Ejemplo n.º 9
0
    // Start is called before the first frame update
    void Start()
    {
        timeWarp = gameObject.GetComponent <TimeWarp>();

        actionset.Activate();
        timeWarpInput[inputSource].onChange += OnWarpAction;;
    }
Ejemplo n.º 10
0
 void Start()
 {
     wceAction.Activate();
     DischargeObserve();
     PauseButtonObserve();
     AttributeChangeObserve();
 }
Ejemplo n.º 11
0
    // Start is called before the first frame update
    void Start()
    {
        animator = GetComponent <Animator>();
        root     = transform.Find("Root");

        steamVR_ActionSet.Activate(SteamVR_Input_Sources.Any, 0, true);
        animationController = GetComponent <RobotAnimation>();
    }
Ejemplo n.º 12
0
    // Start is called before the first frame update. At the beginning user is in menu and robot is locked.
    void Start()
    {
        playerTextPanel.SetActive(false);

        inMenu   = true;
        isLocked = true;
        menuSet.Activate();
    }
Ejemplo n.º 13
0
        public void TempEnableInteraction(SteamVR_Input_Sources source)
        {
            if (interactionEnabled)
            {
                return;
            }

            //mainActionSet.Deactivate(SteamVR_Input_Sources.Any);
            mainActionSet.Activate(SteamVR_Input_Sources.Any, 0x01000001);
        }
Ejemplo n.º 14
0
    //----------------------------VR

    private void OnEnable()
    {
        squeezeActions.Activate();

        if (squeezePause != null)
        {
            squeezePause.AddOnChangeListener(OnTriggerPressedOrReleased, inputSource);
            //Debug.Log("StageMenuManager Awake Has Ran");
        }
    }
Ejemplo n.º 15
0
 // Initialize button actions for y position controls of player.
 private void InitializeButtons()
 {
     button_down.onStateDown += Button_down_onStateDown;
     button_down.onState     += Button_down_onState;
     button_down.onStateUp   += Button_down_onStateUp;
     button_up.onStateDown   += Button_up_onStateDown;
     button_up.onState       += Button_up_onState;
     button_up.onStateUp     += Button_up_onStateUp;
     playerControlActionSet.Activate();
 }
    private void Awake()
    {
        if (actionSet == null)
        {
            actionSet = SteamVR_Actions.Controller_Tests;
        }
        actionSet.Activate(SteamVR_Input_Sources.Any, 0, true);
        Left_Hand_Skeleton = SteamVR_Actions.Controller_Tests.Left_Hand_Skeleton;
        triggered          = SteamVR_Actions.Controller_Tests.Left_Trigger_Click;

        triggered[SteamVR_Input_Sources.Any].onStateDown += PreformAction;
    }
Ejemplo n.º 17
0
 public void Start()
 {
     try {
         scoreManager = (ScoreManager.ScoreManager)core.pluginManager.Find("score_manager");
     }
     catch (Exception e) {
         Debug.Log(e);
     }
     uiActionSet.Activate();
     ToMainMenu();
     PopulateInGamePanels();
 }
Ejemplo n.º 18
0
    // Start is called before the first frame update
    void Start()
    {
        teleport = Object.FindObjectOfType <Teleport>();

        myAction.Activate();

        targetObjects.SetActive(false);

        //teleportPoints = GameObject.FindGameObjectsWithTag("TeleportPoint");
        //foreach (GameObject obj in teleportPoints)
        //    obj.SetActive(false);
    }
Ejemplo n.º 19
0
        private void updateMainActionSetState()
        {
            bool useVrControls = VHVRConfig.UseVrControls();

            if (!useVrControls && mainActionSet.IsActive())
            {
                mainActionSet.Deactivate();
            }
            else if (useVrControls && !mainActionSet.IsActive())
            {
                mainActionSet.Activate();
            }
        }
Ejemplo n.º 20
0
 public virtual void OnPickup(MyHand hand)
 {
     // activate ActionSet
     if (activateActionSet != null)
     {
         activateActionSet.Activate(hand.handType);
     }
     // hide hand model
     if (hideHandModelOnPickUp)
     {
         hand.transform.GetChild(0).gameObject.SetActive(false);
     }
 }
Ejemplo n.º 21
0
 private void ActionSetPointcloudViewEnabled(bool enabled)
 {
     if (_action_set_pointcloud_view != null)
     {
         if (enabled)
         {
             _action_set_pointcloud_view.Activate();
         }
         else
         {
             _action_set_pointcloud_view.Deactivate();
         }
     }
 }
Ejemplo n.º 22
0
    void UpdateDisplay()
    {
        ui_actionInput.SetActive(drawActionInput);
        ui_rawInput.SetActive(drawRawInput);

        if (drawRawInput)
        {
            rawActionSet.Activate();
        }
        else
        {
            rawActionSet.Deactivate();
        }
    }
Ejemplo n.º 23
0
    // Start is called before the first frame update.
    // RosBridge is used to decide whether Ros is connected to Unity. Only than the simulation scene can be started.

    void Start()
    {
        rosbridge = GameObject.Find("RosBridge").GetComponent <RosConnector>();

        line               = GetComponent <LineRenderer>();
        line.startWidth    = 0.005f;
        line.endWidth      = 0.001f;
        line.positionCount = 2;

        robots = GameObject.FindGameObjectsWithTag("robot");

        trigger.onStateDown += Trigger_onStateDown;
        SelectRobot.Activate();
    }
Ejemplo n.º 24
0
 void SelectActionSet()
 {
     if (inZone == true)
     {
         //Debug.Log(string.Format("[SteamVR] Activating {0} action set.", actionSet.fullPath));
         dartsActionSet.Activate(forSources, 0, disableAllOtherActionSets);
         //defaultActionSet.Deactivate(forSources);
     }
     else
     {
         dartsActionSet.Deactivate(forSources); // Disable darts action set
         //defaultActionSet.Activate(forSources);
     }
 }
Ejemplo n.º 25
0
 private void ActionSetStartViewEnabled(bool enabled)
 {
     if (_action_set_start_view != null)
     {
         if (enabled)
         {
             _action_set_start_view.Activate();
         }
         else
         {
             _action_set_start_view.Deactivate();
         }
     }
 }
Ejemplo n.º 26
0
    private void Awake()
    {
        if (_gameStart)
        {
            return;
        }
        ExperimentManagerVariable = this;

        _locomotionManager = FindObjectOfType <LocomotionManager>();
        _switchShader      = FindObjectOfType <SwitchShader>();
        _writeToFile       = gameObject.AddComponent <WriteToFile>();

        ActionSet.Activate(SteamVR_Input_Sources.Any, 0, true);

        _gameStart = true;
    }
Ejemplo n.º 27
0
 private void updateLasersActionSetState()
 {
     if (!mainActionSet.IsActive())
     {
         laserActionSet.Deactivate();
         return;
     }
     if (laserActionSet.IsActive() && VRPlayer.activePointer == null)
     {
         laserActionSet.Deactivate();
     }
     else if (!laserActionSet.IsActive() && VRPlayer.activePointer != null)
     {
         laserActionSet.Activate(SteamVR_Input_Sources.Any, 1 /* Higher priority than main action set */);
     }
 }
Ejemplo n.º 28
0
        protected virtual void OnAttachedToHand(Hand hand)
        {
            if (activateActionSetOnAttach != null)
            {
                activateActionSetOnAttach.Activate(hand.handType);
            }

            if (onAttachedToHand != null)
            {
                onAttachedToHand.Invoke(hand);
            }

            if (skeletonPoser != null && hand.skeleton != null)
            {
                hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime);
            }
            Debug.Log("ATTACHED");
            attachedToHand = hand;
        }
        protected virtual void OnAttachedToHand(IF_VR_Steam_Hand hand)
        {
            if (activateActionSetOnAttach != null)
            {
                activateActionSetOnAttach.Activate(hand.handType);
            }

            if (onAttachedToHand != null)
            {
                onAttachedToHand.Invoke(hand);
            }

            if (skeletonPoser != null && hand.skeleton != null)
            {
                hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime);
            }

            attachedToHand = hand;
        }
Ejemplo n.º 30
0
        protected virtual void OnAttachedToHand(Hand hand)
        {
            if (!string.IsNullOrEmpty(activateActionSetOnAttach.GetPath()))
            {
                activateActionSetOnAttach.Activate(hand.handType);
            }

            if (onAttachedToHand != null)
            {
                onAttachedToHand.Invoke(hand);
            }

            if (skeletonPoser != null && hand.skeleton != null)
            {
                hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime);
            }

            attachedToHand = hand;
        }