public static void VrCamera(bool ena)
    {
        GameObject player = GameObject.FindGameObjectWithTag("PlayArea");

        if (player == null)
        {
            return;
        }
        VRTK.VRTK_HeightAdjustTeleport heights   = player.GetComponent <VRTK.VRTK_HeightAdjustTeleport>();
        VRTK.VRTK_BodyPhysics          physicses = player.GetComponent <VRTK.VRTK_BodyPhysics>();
        VRTK.VRTK_BasicTeleport        basics    = player.GetComponent <VRTK.VRTK_BasicTeleport>();

        if (heights != null)
        {
            heights.enabled = ena;
        }
        if (physicses != null)
        {
            physicses.enabled = ena;
        }
        if (basics != null)
        {
            basics.enabled = !ena;
        }
    }
Beispiel #2
0
        protected virtual void OnEnable()
        {
            trackedObjects.Clear();
            movementList.Clear();
            previousYPositions.Clear();
            initialGaze          = Vector3.zero;
            currentDirection     = Vector3.zero;
            previousDirection    = Vector3.zero;
            averagePeriod        = 60;
            currentSpeed         = 0f;
            movementEngaged      = false;
            previousEngageButton = engageButton;

            bodyPhysics         = (bodyPhysics != null ? bodyPhysics : FindObjectOfType <VRTK_BodyPhysics>());
            controllerLeftHand  = VRTK_DeviceFinder.GetControllerLeftHand();
            controllerRightHand = VRTK_DeviceFinder.GetControllerRightHand();

            SetControllerListeners(controllerLeftHand, leftController, ref leftSubscribed);
            SetControllerListeners(controllerRightHand, rightController, ref rightSubscribed);

            headset = VRTK_DeviceFinder.HeadsetTransform();

            SetControlOptions(controlOptions);

            playArea = VRTK_DeviceFinder.PlayAreaTransform();

            // Initialize the lists.
            for (int i = 0; i < trackedObjects.Count; i++)
            {
                Transform trackedObj = trackedObjects[i];
                VRTK_SharedMethods.AddDictionaryValue(movementList, trackedObj, new List <float>(), true);
                VRTK_SharedMethods.AddDictionaryValue(previousYPositions, trackedObj, trackedObj.transform.localPosition.y, true);
            }
        }
Beispiel #3
0
        protected virtual void Awake()
        {
            bodyPhysics = (bodyPhysics != null ? bodyPhysics : GetComponentInChildren <VRTK_BodyPhysics>());
            teleporter  = (teleporter != null ? teleporter : GetComponentInChildren <VRTK_BasicTeleport>());

            VRTK_SDKManager.instance.AddBehaviourToToggleOnLoadedSetupChange(this);
        }
Beispiel #4
0
        protected virtual void Awake()
        {
            bodyPhysics      = (bodyPhysics != null ? bodyPhysics : GetComponentInChildren <VRTK_BodyPhysics>());
            teleporter       = (teleporter != null ? teleporter : GetComponentInChildren <VRTK_BasicTeleport>());
            headsetCollision = (headsetCollision != null ? headsetCollision : GetComponentInChildren <VRTK_HeadsetCollision>());
            positionRewind   = (positionRewind != null ? positionRewind : GetComponentInChildren <VRTK_PositionRewind>());

            VRTK_SDKManager.instance.AddBehaviourToToggleOnLoadedSetupChange(this);
        }
 protected virtual void OnEnable()
 {
     SetControllerListeners(controllerLeftHand, leftController, ref leftSubscribed);
     SetControllerListeners(controllerRightHand, rightController, ref rightSubscribed);
     bodyPhysics   = GetComponent <VRTK_BodyPhysics>();
     movementSpeed = 0f;
     strafeSpeed   = 0f;
     multiplySpeed = false;
 }
Beispiel #6
0
 protected virtual void OnEnable()
 {
     lastGoodPositionSet = false;
     headset             = VRTK_DeviceFinder.HeadsetTransform();
     playArea            = VRTK_DeviceFinder.PlayAreaTransform();
     bodyPhysics         = (bodyPhysics != null ? bodyPhysics : FindObjectOfType <VRTK_BodyPhysics>());
     headsetCollision    = (headsetCollision != null ? headsetCollision : GetComponentInChildren <VRTK_HeadsetCollision>());
     ManageListeners(true);
 }
Beispiel #7
0
        protected virtual void OnDisable()
        {
            bodyPhysics = null;
            SetControllerListeners(controllerLeftHand, leftController, ref leftSubscribed, true);
            SetControllerListeners(controllerRightHand, rightController, ref rightSubscribed, true);

            controllerLeftHand  = null;
            controllerRightHand = null;
            headset             = null;
            playArea            = null;
        }
Beispiel #8
0
        // Token: 0x060017EC RID: 6124 RVA: 0x0007FBA8 File Offset: 0x0007DDA8
        protected virtual bool CanMove(VRTK_BodyPhysics givenBodyPhysics, Vector3 currentPosition, Vector3 proposedPosition)
        {
            if (givenBodyPhysics == null)
            {
                return(true);
            }
            Vector3 normalized  = (proposedPosition - currentPosition).normalized;
            float   maxDistance = Vector3.Distance(currentPosition, proposedPosition);

            return(!givenBodyPhysics.SweepCollision(normalized, maxDistance));
        }
Beispiel #9
0
        public override void OnEnter()
        {
            var go = Fsm.GetOwnerDefaultTarget(gameObject);

            theScript = go.GetComponent <VRTK.VRTK_BodyPhysics>();

            if (!everyFrame.Value)
            {
                MakeItSo();
                Finish();
            }
        }
        protected virtual void OnEnable()
        {
            touchpadAxis       = Vector2.zero;
            storedTouchpadAxis = Vector2.zero;
            controllerEvents   = GetComponent <VRTK_ControllerEvents>();
            SetControlledObject();
            bodyPhysics         = (!controlOverrideObject ? FindObjectOfType <VRTK_BodyPhysics>() : null);
            touchpadFirstChange = true;

            directionDevice = GetDirectionDevice();
            SetListeners(true);
            otherTouchpadControl = GetOtherControl();
        }
Beispiel #11
0
        protected virtual void OnEnable()
        {
            lastGoodPositionSet = false;
            headset             = VRTK_DeviceFinder.HeadsetTransform();
            playArea            = VRTK_DeviceFinder.PlayAreaTransform();
            if (playArea == null)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.SDK_OBJECT_NOT_FOUND, "PlayArea", "Boundaries SDK"));
            }

            bodyPhysics      = (bodyPhysics != null ? bodyPhysics : FindObjectOfType <VRTK_BodyPhysics>());
            headsetCollision = (headsetCollision != null ? headsetCollision : GetComponentInChildren <VRTK_HeadsetCollision>());
            ManageListeners(true);
        }
        protected virtual void OnEnable()
        {
            SetControllerListeners(controllerLeftHand, leftController, ref leftSubscribed);
            SetControllerListeners(controllerRightHand, rightController, ref rightSubscribed);
            bodyPhysics = GetComponent <VRTK_BodyPhysics>();

            movementSpeed    = 0f;
            strafeSpeed      = 0f;
            blinkFadeInTime  = 0f;
            lastWarp         = 0f;
            lastFlip         = 0f;
            lastSnapRotate   = 0f;
            multiplyMovement = false;
        }
Beispiel #13
0
 protected virtual void OnEnable()
 {
     lastGoodPositionSet = false;
     headset             = VRTK_DeviceFinder.HeadsetTransform();
     playArea            = VRTK_DeviceFinder.PlayAreaTransform();
     bodyPhysics         = FindObjectOfType <VRTK_BodyPhysics>();
     playareaRigidbody   = playArea.GetComponent <Rigidbody>();
     headsetCollision    = GetComponent <VRTK_HeadsetCollision>();
     ManageHeadsetListeners(true);
     if (!playArea)
     {
         VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.SDK_OBJECT_NOT_FOUND, "PlayArea", "Boundaries SDK"));
     }
 }
Beispiel #14
0
 protected virtual void OnEnable()
 {
     lastGoodPositionSet = false;
     headset             = VRTK_DeviceFinder.HeadsetTransform();
     playArea            = VRTK_DeviceFinder.PlayAreaTransform();
     bodyPhysics         = FindObjectOfType <VRTK_BodyPhysics>();
     playareaRigidbody   = playArea.GetComponent <Rigidbody>();
     headsetCollision    = GetComponent <VRTK_HeadsetCollision>();
     ManageHeadsetListeners(true);
     if (!playArea)
     {
         Debug.LogError("No play area could be found. Have you selected a valid Boundaries SDK in the SDK Manager? If you are unsure, then click the GameObject with the `VRTK_SDKManager` script attached to it in Edit Mode and select a Boundaries SDK from the dropdown.");
     }
 }
Beispiel #15
0
        protected virtual void Awake()
        {
            bodyPhysics = (bodyPhysics != null ? bodyPhysics : FindObjectOfType <VRTK_BodyPhysics>());

            if (bodyPhysics == null)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_SCENE, "VRTK_PlayerClimb", "VRTK_BodyPhysics"));
            }

            teleporter       = (teleporter != null ? teleporter : FindObjectOfType <VRTK_BasicTeleport>());
            headsetCollision = (headsetCollision != null ? headsetCollision : FindObjectOfType <VRTK_HeadsetCollision>());
            positionRewind   = (positionRewind != null ? positionRewind : FindObjectOfType <VRTK_PositionRewind>());

            VRTK_SDKManager.instance.AddBehaviourToToggleOnLoadedSetupChange(this);
        }
        protected virtual void OnEnable()
        {
            currentAxis      = Vector2.zero;
            storedAxis       = Vector2.zero;
            controllerEvents = (controller != null ? controller : GetComponent <VRTK_ControllerEvents>());
            if (!controllerEvents)
            {
                Debug.LogError("A `VRTK_ControllerEvents` script is required for the `VRTK_ObjectControl` script to work. Either the `controller` parameter is not set or no `VRTK_ControllerEvents` is attached to this GameObject.");
                return;
            }
            SetControlledObject();
            bodyPhysics = (!controlOverrideObject ? FindObjectOfType <VRTK_BodyPhysics>() : null);

            directionDevice = GetDirectionDevice();
            SetListeners(true);
            otherObjectControl = GetOtherControl();
        }
Beispiel #17
0
        protected virtual void OnEnable()
        {
            currentAxis      = Vector2.zero;
            storedAxis       = Vector2.zero;
            controllerEvents = (controller != null ? controller : GetComponentInParent <VRTK_ControllerEvents>());
            if (!controllerEvents)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_NOT_INJECTED, "VRTK_ObjectControl", "VRTK_ControllerEvents", "controller", "the same"));
                return;
            }
            SetControlledObject();
            bodyPhysics = (!controlOverrideObject ? (bodyPhysics != null ? bodyPhysics : FindObjectOfType <VRTK_BodyPhysics>()) : null);

            directionDevice = GetDirectionDevice();
            SetListeners(true);
            otherObjectControl = GetOtherControl();
        }
        protected virtual void OnEnable()
        {
            playArea = VRTK_DeviceFinder.PlayAreaTransform();
            if (objectControlScript)
            {
                switch (listenOnAxisChange)
                {
                case AxisListeners.XAxisChanged:
                    objectControlScript.XAxisChanged += AxisChanged;
                    break;

                case AxisListeners.YAxisChanged:
                    objectControlScript.YAxisChanged += AxisChanged;
                    break;
                }
            }
            internalBodyPhysics = (internalBodyPhysics == null ? VRTK_SharedMethods.FindEvenInactiveComponent <VRTK_BodyPhysics>() : internalBodyPhysics);
        }
        protected virtual void OnEnable()
        {
            touchpadAxisChanged = new ControllerInteractionEventHandler(DoTouchpadAxisChanged);
            touchpadUntouched   = new ControllerInteractionEventHandler(DoTouchpadTouchEnd);
            playArea            = VRTK_DeviceFinder.PlayAreaTransform();
            controllerLeftHand  = VRTK_DeviceFinder.GetControllerLeftHand();
            controllerRightHand = VRTK_DeviceFinder.GetControllerRightHand();
            if (!playArea)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.SDK_OBJECT_NOT_FOUND, "PlayArea", "Boundaries SDK"));
            }

            VRTK_PlayerObject.SetPlayerObject(gameObject, VRTK_PlayerObject.ObjectTypes.CameraRig);

            SetControllerListeners(controllerLeftHand, leftController, ref leftSubscribed);
            SetControllerListeners(controllerRightHand, rightController, ref rightSubscribed);
            bodyPhysics   = GetComponent <VRTK_BodyPhysics>();
            movementSpeed = 0f;
            strafeSpeed   = 0f;
            multiplySpeed = false;
        }
Beispiel #20
0
        protected virtual void OnEnable()
        {
            touchpadAxisChanged = new ControllerInteractionEventHandler(DoTouchpadAxisChanged);
            touchpadUntouched   = new ControllerInteractionEventHandler(DoTouchpadTouchEnd);

            controllerLeftHand  = VRTK_DeviceFinder.GetControllerLeftHand();
            controllerRightHand = VRTK_DeviceFinder.GetControllerRightHand();

            playArea = VRTK_DeviceFinder.PlayAreaTransform();
            if (!playArea)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.SDK_OBJECT_NOT_FOUND, "PlayArea", "Boundaries SDK"));
            }

            headset = VRTK_DeviceFinder.HeadsetTransform();
            if (!headset)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.SDK_OBJECT_NOT_FOUND, "HeadsetTransform", "Headset SDK"));
            }

            VRTK_PlayerObject.SetPlayerObject(gameObject, VRTK_PlayerObject.ObjectTypes.CameraRig);

            SetControllerListeners(controllerLeftHand, leftController, ref leftSubscribed);
            SetControllerListeners(controllerRightHand, rightController, ref rightSubscribed);
            bodyPhysics = GetComponent <VRTK_BodyPhysics>();

            movementSpeed    = 0f;
            strafeSpeed      = 0f;
            blinkFadeInTime  = 0f;
            lastWarp         = 0f;
            lastFlip         = 0f;
            lastSnapRotate   = 0f;
            multiplyMovement = false;

            bodyCollider = playArea.GetComponentInChildren <CapsuleCollider>();
            if (!bodyCollider)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "VRTK_TouchpadMovement", "CapsuleCollider", "the PlayArea"));
            }
        }
Beispiel #21
0
        protected virtual void OnEnable()
        {
            trackedObjects       = new List <Transform>();
            movementList         = new Dictionary <Transform, List <float> >();
            previousYPositions   = new Dictionary <Transform, float>();
            initalGaze           = Vector3.zero;
            direction            = Vector3.zero;
            previousDirection    = Vector3.zero;
            averagePeriod        = 60;
            currentSpeed         = 0f;
            active               = false;
            previousEngageButton = engageButton;

            bodyPhysics         = (bodyPhysics != null ? bodyPhysics : GetComponentInChildren <VRTK_BodyPhysics>());
            controllerLeftHand  = VRTK_DeviceFinder.GetControllerLeftHand();
            controllerRightHand = VRTK_DeviceFinder.GetControllerRightHand();

            SetControllerListeners(controllerLeftHand, leftController, ref leftSubscribed);
            SetControllerListeners(controllerRightHand, rightController, ref rightSubscribed);

            headset = VRTK_DeviceFinder.HeadsetTransform();

            SetControlOptions(controlOptions);

            playArea = VRTK_DeviceFinder.PlayAreaTransform();

            // Initialize the lists.
            for (int i = 0; i < trackedObjects.Count; i++)
            {
                Transform trackedObj = trackedObjects[i];
                movementList.Add(trackedObj, new List <float>());
                previousYPositions.Add(trackedObj, trackedObj.transform.localPosition.y);
            }
            if (playArea == null)
            {
                VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.SDK_OBJECT_NOT_FOUND, "PlayArea", "Boundaries SDK"));
            }
        }
Beispiel #22
0
        protected virtual void OnEnable()
        {
            trackedObjects       = new List <Transform>();
            movementList         = new Dictionary <Transform, List <float> >();
            previousYPositions   = new Dictionary <Transform, float>();
            initalGaze           = Vector3.zero;
            direction            = Vector3.zero;
            previousDirection    = Vector3.zero;
            averagePeriod        = 60;
            currentSpeed         = 0f;
            active               = false;
            previousEngageButton = engageButton;

            bodyPhysics         = GetComponent <VRTK_BodyPhysics>();
            controllerLeftHand  = VRTK_DeviceFinder.GetControllerLeftHand();
            controllerRightHand = VRTK_DeviceFinder.GetControllerRightHand();

            SetControllerListeners(controllerLeftHand, leftController, ref leftSubscribed);
            SetControllerListeners(controllerRightHand, rightController, ref rightSubscribed);

            headset = VRTK_DeviceFinder.HeadsetTransform();

            SetControlOptions(controlOptions);

            playArea = VRTK_DeviceFinder.PlayAreaTransform();

            // Initialize the lists.
            foreach (Transform trackedObj in trackedObjects)
            {
                movementList.Add(trackedObj, new List <float>());
                previousYPositions.Add(trackedObj, trackedObj.transform.localPosition.y);
            }
            if (!playArea)
            {
                Debug.LogError("No play area could be found. Have you selected a valid Boundaries SDK in the SDK Manager? If you are unsure, then click the GameObject with the `VRTK_SDKManager` script attached to it in Edit Mode and select a Boundaries SDK from the dropdown.");
            }
        }
 protected virtual void OnDisable()
 {
     SetControllerListeners(controllerLeftHand, leftController, ref leftSubscribed, true);
     SetControllerListeners(controllerRightHand, rightController, ref rightSubscribed, true);
     bodyPhysics = null;
 }
Beispiel #24
0
        }                                                                                                                                                                                                                                                                                                      // 0x000000018144C120-0x000000018144C3E0

        protected virtual bool u0927u091Eu0922u0928u091Cu091Fu091Eu0923u091Au091Bu0921(VRTK_BodyPhysics u0929u0921u0923u091Du0929u091Bu0920u0923u091Du0926u0927, Vector3 u091Bu0927u091Cu091Cu0929u091Du0926u091Du091Bu0928u0922, Vector3 u0921u091Du091Du091Fu091Du0928u091Cu091Au091Eu091Bu0922) => default; // 0x000000018144EF90-0x000000018144F120
 private void Awake()
 {
     playArea    = VRTK_DeviceFinder.PlayAreaTransform();
     bodyPhysics = GetComponent <VRTK_BodyPhysics>();
 }
Beispiel #26
0
 protected virtual void Awake()
 {
     playArea    = VRTK_DeviceFinder.PlayAreaTransform();
     bodyPhysics = GetComponent <VRTK_BodyPhysics>();
 }
Beispiel #27
0
 protected virtual void Awake()
 {
     bodyPhysics = (bodyPhysics != null ? bodyPhysics : FindObjectOfType <VRTK_BodyPhysics>());
     playerClimb = (playerClimb != null ? playerClimb : FindObjectOfType <VRTK_PlayerClimb>());
     VRTK_SDKManager.instance.AddBehaviourToToggleOnLoadedSetupChange(this);
 }
Beispiel #28
0
 protected virtual int u091Fu0925u0924u0920u0923u091Cu091Au091Fu0929u091Du091F(float u0929u0922u0922u0925u091Cu091Du0925u091Cu091Fu0929u0928) => default;                                                                                                                                               // 0x0000000180E08C80-0x0000000180E08CA0
 protected virtual bool u0925u0922u0922u0927u091Eu0924u0927u091Bu0923u091Fu091B(VRTK_BodyPhysics u0929u0921u0923u091Du0929u091Bu0920u0923u091Du0926u0927, Vector3 u091Bu0927u091Cu091Cu0929u091Du0926u091Du091Bu0928u0922, Vector3 u0921u091Du091Du091Fu091Du0928u091Cu091Au091Eu091Bu0922) => default; // 0x0000000180E09500-0x0000000180E09690