Ejemplo n.º 1
0
 public virtual void OnControllerUnuseInteractableObject(ObjectInteractEventArgs e)
 {
     if (ControllerUnuseInteractableObject != null)
     {
         ControllerUnuseInteractableObject(this, e);
     }
 }
 private void OnUngrabObject(object sender, ObjectInteractEventArgs e)
 {
     if (e.target.GetComponent<VRTK_InteractableObject>() && !e.target.GetComponent<VRTK_InteractableObject>().IsGrabbed())
     {
         Physics.IgnoreCollision(this.GetComponent<Collider>(), e.target.GetComponent<Collider>(), false);
     }
 }
Ejemplo n.º 3
0
 protected virtual void OnGrabObject(object sender, ObjectInteractEventArgs e)
 {
     if (IsClimbableObject(e.target))
     {
         var controller       = ((VRTK_InteractGrab)sender).gameObject;
         var actualController = VRTK_DeviceFinder.GetActualController(controller);
         Grab(actualController, e.controllerReference, e.target);
     }
 }
Ejemplo n.º 4
0
        private void OnUngrabObject(object sender, ObjectInteractEventArgs e)
        {
            var controller = ((VRTK_InteractGrab)sender).gameObject;

            if (e.target && IsClimbableObject(e.target) && IsActiveClimbingController(controller))
            {
                Ungrab(true, e.controllerIndex, e.target);
            }
        }
Ejemplo n.º 5
0
        public virtual void OnControllerStartGrabInteractableObject(ObjectInteractEventArgs e)
        {
            if (ControllerStartGrabInteractableObject != null)
            {
                ControllerStartGrabInteractableObject(this, e);
            }

            //grabbedObject
        }
Ejemplo n.º 6
0
        public virtual void OnControllerNearTouchInteractableObject(ObjectInteractEventArgs e)
        {
            VRTK_SharedMethods.AddListValue(nearTouchedObjects, e.target, true);

            if (ControllerNearTouchInteractableObject != null)
            {
                ControllerNearTouchInteractableObject(this, e);
            }
        }
Ejemplo n.º 7
0
        public virtual void OnControllerNearUntouchInteractableObject(ObjectInteractEventArgs e)
        {
            nearTouchedObjects.Remove(e.target);

            if (ControllerNearUntouchInteractableObject != null)
            {
                ControllerNearUntouchInteractableObject(this, e);
            }
        }
Ejemplo n.º 8
0
        // Token: 0x06001825 RID: 6181 RVA: 0x0008079C File Offset: 0x0007E99C
        protected virtual void OnUngrabObject(object sender, ObjectInteractEventArgs e)
        {
            GameObject actualController = VRTK_DeviceFinder.GetActualController(((VRTK_InteractGrab)sender).gameObject);

            if (e.target && this.IsClimbableObject(e.target) && this.IsActiveClimbingController(actualController))
            {
                this.Ungrab(true, e.controllerReference, e.target);
            }
        }
Ejemplo n.º 9
0
        protected virtual void DoControllerGrab(object sender, ObjectInteractEventArgs e)
        {
            bool isUsing = (interactUse != null && interactUse.GetUsingObject() != null);

            float[] overrideValues     = (GetOverrideValues((isUsing ? useOverrides : grabOverrides)));
            float[] overrideFingerAxis = (isUsing ? GetOverrideValues(grabOverrides) : fingerAxis);
            SetAnimatorStateOn("GrabState", grabOverrides);
            HandleOverrideOn(grabOverrides.ignoreAllOverrides, overrideFingerAxis, GetOverridePermissions(grabOverrides), overrideValues);
        }
Ejemplo n.º 10
0
        protected virtual void OnUngrabObject(object sender, ObjectInteractEventArgs e)
        {
            var controller       = ((VRTK_InteractGrab)sender).gameObject;
            var actualController = VRTK_DeviceFinder.GetActualController(controller);

            if (e.target && IsClimbableObject(e.target) && IsActiveClimbingController(actualController))
            {
                Ungrab(true, e.controllerIndex, e.target);
            }
        }
        private void OnGrabObject(object sender, ObjectInteractEventArgs e)
        {
            if(e.target.GetComponent<Collider>())
            {
                Physics.IgnoreCollision(this.GetComponent<Collider>(), e.target.GetComponent<Collider>(), true);
            }

            foreach(var childCollider in e.target.GetComponentsInChildren<Collider>())
            {
                Physics.IgnoreCollision(this.GetComponent<Collider>(), childCollider, true);
            }
        }
Ejemplo n.º 12
0
 protected virtual void ControllerUntouchInteractableObject(object sender, ObjectInteractEventArgs e)
 {
     if (e.target != null)
     {
         VRTK_InteractableObject touchedObjectScript = e.target.GetComponent <VRTK_InteractableObject>();
         if (!touchedObjectScript.IsGrabbed() && savedGrabButton != VRTK_ControllerEvents.ButtonAlias.Undefined)
         {
             grabButton      = savedGrabButton;
             savedGrabButton = VRTK_ControllerEvents.ButtonAlias.Undefined;
         }
     }
 }
Ejemplo n.º 13
0
 // Token: 0x06001620 RID: 5664 RVA: 0x0007862C File Offset: 0x0007682C
 protected virtual void ControllerUntouchInteractableObject(object sender, ObjectInteractEventArgs e)
 {
     if (e.target != null)
     {
         VRTK_InteractableObject component = e.target.GetComponent <VRTK_InteractableObject>();
         if (component != null && !component.IsUsing(null) && this.savedUseButton != VRTK_ControllerEvents.ButtonAlias.Undefined)
         {
             this.useButton      = this.savedUseButton;
             this.savedUseButton = VRTK_ControllerEvents.ButtonAlias.Undefined;
         }
     }
 }
Ejemplo n.º 14
0
 protected virtual void ControllerTouchInteractableObject(object sender, ObjectInteractEventArgs e)
 {
     if (e.target != null)
     {
         VRTK_InteractableObject touchedObjectScript = e.target.GetComponent <VRTK_InteractableObject>();
         if (touchedObjectScript != null && touchedObjectScript.grabOverrideButton != VRTK_ControllerEvents.ButtonAlias.Undefined)
         {
             savedGrabButton = subscribedGrabButton;
             grabButton      = touchedObjectScript.grabOverrideButton;
         }
     }
 }
Ejemplo n.º 15
0
 // Token: 0x06001592 RID: 5522 RVA: 0x000766E0 File Offset: 0x000748E0
 protected virtual void ControllerTouchInteractableObject(object sender, ObjectInteractEventArgs e)
 {
     if (e.target != null)
     {
         PhotonObjectInteract component = e.target.GetComponent <PhotonObjectInteract>();
         if (component != null && component.grabOverrideButton != VRTK_ControllerEvents.ButtonAlias.Undefined)
         {
             this.savedGrabButton = this.subscribedGrabButton;
             this.grabButton      = component.grabOverrideButton;
         }
     }
 }
        private void OnGrabObject(object sender, ObjectInteractEventArgs e)
        {
            if (e.target.GetComponent <Collider>())
            {
                Physics.IgnoreCollision(GetComponent <Collider>(), e.target.GetComponent <Collider>(), true);
            }

            foreach (var childCollider in e.target.GetComponentsInChildren <Collider>())
            {
                Physics.IgnoreCollision(GetComponent <Collider>(), childCollider, true);
            }
        }
Ejemplo n.º 17
0
 protected virtual void ControllerUntouchInteractableObject(object sender, ObjectInteractEventArgs e)
 {
     if (e.target != null)
     {
         VRTK_InteractableObject touchedObjectScript = e.target.GetComponent<VRTK_InteractableObject>();
         if (touchedObjectScript != null && !touchedObjectScript.IsUsing() && savedUseButton != VRTK_ControllerEvents.ButtonAlias.Undefined)
         {
             useButton = savedUseButton;
             savedUseButton = VRTK_ControllerEvents.ButtonAlias.Undefined;
             ManageUseListener(true);
         }
     }
 }
Ejemplo n.º 18
0
        private void OnGrabObject(object sender, ObjectInteractEventArgs e)
        {
            if (IsClimbableObject(e.target))
            {
                if (useGravity)
                {
                    playerPresence.StopPhysicsFall();
                }

                OnPlayerClimbStarted(SetPlayerClimbEvent(e.controllerIndex, e.target));
                isClimbing              = true;
                controllerTransform     = ((VRTK_InteractGrab)sender).transform;
                startControllerPosition = GetPosition(controllerTransform);
                startPosition           = transform.position;
            }
        }
Ejemplo n.º 19
0
 protected virtual void DoControllerUntouch(object sender, ObjectInteractEventArgs e)
 {
     if (interactNearTouch == null || nearTouchOverrides.ignoreAllOverrides)
     {
         for (int i = 0; i < fingerUntouchedAxis.Length; i++)
         {
             if (!IsButtonPressed(i))
             {
                 SetOverrideValue(i, ref overrideAxisValues, OverrideState.WasOverring);
                 fingerForceAxis[i] = fingerUntouchedAxis[i];
             }
         }
     }
     SetAnimatorStateOff("TouchState");
     HandleOverrideOff(touchOverrides.ignoreAllOverrides, GetOverridePermissions(touchOverrides), false);
 }
Ejemplo n.º 20
0
        public virtual void OnControllerStartTouchInteractableObject(ObjectInteractEventArgs e)
        {
            if (GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>().Mode == 1)
            {
                //  1) Select Node
            }

            if (GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>().Mode == 2)
            {
                //  2) Highlight Node

                touchedObject.GetComponent <ColorSpheres>().Pressed();
            }

            if (GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>().Mode == 3)
            {
                //  3) Start Node
            }

            if (GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>().Mode == 4)
            {
                //  4) End Node
            }

            if (GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>().Mode == 5)
            {
                //need to call the hide function
                touchedObject.GetComponent <Renderer>().sharedMaterial = touchedObject.GetComponent <ColorSpheres>().hidden;
                touchedObject.GetComponent <ColorSpheres>().hide       = true;
                //Need to update graph to hide the nodes
                GraphController Script = GameObject.FindGameObjectWithTag("GameController").GetComponent <GraphController>();
                Script.UpdateGraph();
                touchedObject.SetActive(false);
            }

            if (ControllerStartTouchInteractableObject != null)
            {
                ControllerStartTouchInteractableObject(this, e);
            }
        }
Ejemplo n.º 21
0
 protected virtual void DoControllerUngrab(object sender, ObjectInteractEventArgs e)
 {
     SetAnimatorStateOff("GrabState");
     HandleOverrideOff(grabOverrides.ignoreAllOverrides, GetOverridePermissions(touchOverrides), false);
 }
Ejemplo n.º 22
0
 protected virtual void DoControllerUnuse(object sender, ObjectInteractEventArgs e)
 {
     SetAnimatorStateOff("UseState");
     HandleOverrideOff(useOverrides.ignoreAllOverrides, GetOverridePermissions(useOverrides), true);
 }
Ejemplo n.º 23
0
 private void flowerTrigger(object sender, VRTK.ObjectInteractEventArgs e)
 {
     onFlower = true;
     interactTouch.ControllerStartTouchInteractableObject -= flowerTrigger;
 }
Ejemplo n.º 24
0
        private void OnGrabObject(object sender, ObjectInteractEventArgs e)
        {
            if (IsClimbableObject(e.target))
            {
                climbingObject = e.target;
                if (useGravity)
                {
                    playerPresence.StopPhysicsFall();
                }

                OnPlayerClimbStarted(SetPlayerClimbEvent(e.controllerIndex, climbingObject));
                isClimbing = true;
                controllerTransform = ((VRTK_InteractGrab)sender).transform;
                startControllerPosition = GetPosition(controllerTransform);
                startPosition = transform.position;
            }
        }
Ejemplo n.º 25
0
 private void OnGrabObject(object sender, ObjectInteractEventArgs e)
 {
     Physics.IgnoreCollision(this.GetComponent <Collider>(), e.target.GetComponent <Collider>(), true);
 }
Ejemplo n.º 26
0
 protected virtual void ControllerStartTouchInteractableObject(object sender, ObjectInteractEventArgs e)
 {
     ForceStopNearTouching(e.target);
 }
Ejemplo n.º 27
0
        private void OnUngrabObject(object sender, ObjectInteractEventArgs e)
        {
            var controller = ((VRTK_InteractGrab)sender).gameObject;

            if (e.target && IsClimbableObject(e.target) && IsActiveClimbingController(controller))
            {
                Ungrab(true, e.controllerIndex, e.target);
            }
        }
Ejemplo n.º 28
0
 protected virtual void DoControllerTouch(object sender, ObjectInteractEventArgs e)
 {
     SetAnimatorStateOn("TouchState", touchOverrides);
     HandleOverrideOn(touchOverrides.ignoreAllOverrides, fingerAxis, GetOverridePermissions(touchOverrides), GetOverrideValues(touchOverrides));
 }
 private void OnGrabObject(object sender, ObjectInteractEventArgs e)
 {
     if (e.target)
     {
         StopCoroutine("RestoreCollisions");
         IgnoreCollisions(e.target.GetComponentsInChildren<Collider>(), true);
     }
 }
 private void OnGrabObject(object sender, ObjectInteractEventArgs e)
 {
     Physics.IgnoreCollision(this.GetComponent<Collider>(), e.target.GetComponent<Collider>(), true);
 }
 private void OnUngrabObject(object sender, ObjectInteractEventArgs e)
 {
     if (gameObject.activeInHierarchy)
     {
         StartCoroutine(RestoreCollisions(e.target));
     }
 }