Example #1
0
    private void SyncParentAndDropZone(int ID)
    {
        PhotonObjectInteract component = PhotonView.Find(ID).GetComponent <PhotonObjectInteract>();

        component.transform.SetParent(this.parent);
        this.snapDropZone.ForceSnap(component.gameObject);
    }
Example #2
0
    private void NetworkedGrab(int id)
    {
        if (PhotonView.Find(id) == null)
        {
            return;
        }
        PhotonObjectInteract component = PhotonView.Find(id).GetComponent <PhotonObjectInteract>();

        if (component.transformView)
        {
            component.transformView.m_RotationModel.SynchronizeEnabled = false;
            component.transformView.m_PositionModel.SynchronizeEnabled = false;
        }
        if (!this.view.isMine)
        {
            this.inventoryProps[this.inventoryIndex] = component;
        }
        component.isGrabbed = true;
        component.GetComponent <Rigidbody>().collisionDetectionMode = CollisionDetectionMode.ContinuousSpeculative;
        component.GetComponent <Rigidbody>().isKinematic            = true;
        component.transform.SetParent(this.grabSpotJoint.transform);
        if (component.GetComponent <Tripod>())
        {
            component.transform.localPosition = new Vector3(0f, -0.9f, 0f);
        }
        else
        {
            component.transform.localPosition = Vector3.zero;
        }
        Quaternion localRotation = component.transform.localRotation;

        localRotation.eulerAngles         = component.localPlayerRotation;
        component.transform.localRotation = localRotation;
    }
Example #3
0
    private void NetworkedUnGrab(int id, string itemName)
    {
        if (PhotonView.Find(id) == null)
        {
            return;
        }
        PhotonObjectInteract component = PhotonView.Find(id).GetComponent <PhotonObjectInteract>();

        if (component.transformView)
        {
            component.transformView.m_RotationModel.SynchronizeEnabled = true;
            component.transformView.m_PositionModel.SynchronizeEnabled = true;
        }
        component.isGrabbed = false;
        if (PhotonNetwork.inRoom && !this.view.isMine)
        {
            this.inventoryProps[this.inventoryIndex] = null;
        }
        if (this.view.isMine || !PhotonNetwork.inRoom)
        {
            component.GetComponent <Rigidbody>().isKinematic = component.wasKinematic;
        }
        component.GetComponent <Rigidbody>().collisionDetectionMode = CollisionDetectionMode.Continuous;
        component.transform.SetParent(null);
    }
Example #4
0
        // Token: 0x0600120D RID: 4621 RVA: 0x0006803C File Offset: 0x0006623C
        protected virtual void SnapObject(Collider collider)
        {
            PhotonObjectInteract photonObjectInteract = this.ValidSnapObject(collider.gameObject, false, true);

            if (this.willSnap && !this.isSnapped && photonObjectInteract != null && !photonObjectInteract.IsInSnapDropZone())
            {
                if (base.GetComponentInChildren <PhotonObjectInteract>())
                {
                    return;
                }
                if (base.transform.root.CompareTag("Player") && !this.view.isMine)
                {
                    return;
                }
                if (this.highlightObject != null)
                {
                    this.highlightObject.SetActive(false);
                }
                Vector3 newLocalScale = this.GetNewLocalScale(photonObjectInteract);
                if (this.transitionInPlace != null)
                {
                    base.StopCoroutine(this.transitionInPlace);
                }
                this.isSnapped            = true;
                this.currentSnappedObject = photonObjectInteract.gameObject;
                if (this.cloneNewOnUnsnap)
                {
                    this.CreatePermanentClone();
                }
                this.transitionInPlace = base.StartCoroutine(this.UpdateTransformDimensions(photonObjectInteract, this.highlightContainer, newLocalScale, this.snapDuration));
                photonObjectInteract.ToggleSnapDropZone(this, true);
            }
            this.isSnapped  = ((!this.isSnapped || !photonObjectInteract || !photonObjectInteract.IsGrabbed(null)) && this.isSnapped);
            this.wasSnapped = false;
        }
Example #5
0
    // Token: 0x06000665 RID: 1637 RVA: 0x00023A40 File Offset: 0x00021C40
    private void PerformGhostAbility(PhotonObjectInteract obj = null, PhotonObjectInteract[] objects = null)
    {
        switch (this.ghostInfo.ghostTraits.ghostType)
        {
        case GhostTraits.Type.Spirit:
        case GhostTraits.Type.Mare:
        case GhostTraits.Type.Revenant:
            break;

        case GhostTraits.Type.Wraith:
            this.stateMachine.ChangeState(new WraithPower(this, this.ghostInteraction, this.agent));
            return;

        case GhostTraits.Type.Phantom:
            this.stateMachine.ChangeState(new PhantomPower(this, this.ghostInteraction, this.agent));
            return;

        case GhostTraits.Type.Poltergeist:
            this.stateMachine.ChangeState(new PoltergeistPower(this, this.ghostInteraction, this.mask, objects));
            return;

        case GhostTraits.Type.Banshee:
            this.stateMachine.ChangeState(new BansheePower(this, this.ghostInteraction, this.ghostAudio, this.agent, this.mask));
            return;

        case GhostTraits.Type.Jinn:
            this.stateMachine.ChangeState(new JinnPower(this, this.ghostInteraction));
            break;

        default:
            return;
        }
    }
Example #6
0
 // Token: 0x0600159B RID: 5531 RVA: 0x00076A40 File Offset: 0x00074C40
 protected virtual void ChooseGrabSequence(PhotonObjectInteract grabbedObjectScript)
 {
     if (!grabbedObjectScript.isGrabbed || grabbedObjectScript.IsSwappable())
     {
         this.InitPrimaryGrab(grabbedObjectScript);
         return;
     }
     this.InitSecondaryGrab(grabbedObjectScript);
 }
Example #7
0
 // Token: 0x060011F5 RID: 4597 RVA: 0x00067A18 File Offset: 0x00065C18
 public virtual void ForceUnsnap()
 {
     if (this.isSnapped && this.currentSnappedObject != null)
     {
         PhotonObjectInteract photonObjectInteract = this.ValidSnapObject(this.currentSnappedObject, false, true);
         if (photonObjectInteract != null)
         {
             photonObjectInteract.ToggleSnapDropZone(this, false);
         }
     }
 }
Example #8
0
 // Token: 0x0600159D RID: 5533 RVA: 0x00076AC4 File Offset: 0x00074CC4
 protected virtual void InitGrabbedObject()
 {
     this.grabbedObject = ((this.interactTouch != null) ? this.interactTouch.GetTouchedObject() : null);
     if (this.grabbedObject != null)
     {
         this.OnControllerStartGrabInteractableObject(this.interactTouch.SetControllerInteractEvent(this.grabbedObject));
         PhotonObjectInteract component = this.grabbedObject.GetComponent <PhotonObjectInteract>();
         this.ChooseGrabSequence(component);
         this.ToggleControllerVisibility(false);
         this.OnControllerGrabInteractableObject(this.interactTouch.SetControllerInteractEvent(this.grabbedObject));
     }
 }
Example #9
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;
         }
     }
 }
Example #10
0
 // Token: 0x06001596 RID: 5526 RVA: 0x000768F0 File Offset: 0x00074AF0
 protected virtual void SetUndroppableObject()
 {
     if (this.undroppableGrabbedObject != null)
     {
         PhotonObjectInteract component = this.undroppableGrabbedObject.GetComponent <PhotonObjectInteract>();
         if (component != null && component.IsDroppable())
         {
             this.undroppableGrabbedObject = null;
             return;
         }
         this.undroppableGrabbedObject.SetActive(false);
     }
 }
Example #11
0
    // Token: 0x06000681 RID: 1665 RVA: 0x000246B8 File Offset: 0x000228B8
    public PhotonObjectInteract GetPropToThrow()
    {
        PhotonObjectInteract result = null;

        for (int i = 0; i < this.objectsToInteractWith.Count; i++)
        {
            if (this.objectsToInteractWith[i].isProp && !this.objectsToInteractWith[i].GetComponent <Joint>())
            {
                result = this.objectsToInteractWith[i];
            }
        }
        return(result);
    }
Example #12
0
 // Token: 0x06001595 RID: 5525 RVA: 0x0007687C File Offset: 0x00074A7C
 protected virtual void RegrabUndroppableObject()
 {
     if (this.undroppableGrabbedObject != null)
     {
         PhotonObjectInteract component = this.undroppableGrabbedObject.GetComponent <PhotonObjectInteract>();
         if (this.interactTouch != null && component != null && !component.isGrabbed)
         {
             this.undroppableGrabbedObject.SetActive(true);
             this.interactTouch.ForceTouch(this.undroppableGrabbedObject);
             this.AttemptGrab();
             return;
         }
     }
     else
     {
         this.undroppableGrabbedObject = null;
     }
 }
Example #13
0
    // Token: 0x0600067D RID: 1661 RVA: 0x0002441C File Offset: 0x0002261C
    public void GhostWriting()
    {
        PhotonObjectInteract photonObjectInteract = null;

        for (int i = 0; i < this.objectsToInteractWith.Count; i++)
        {
            if (this.objectsToInteractWith[i].GetComponent <GhostWriting>())
            {
                photonObjectInteract = this.objectsToInteractWith[i];
            }
        }
        if (photonObjectInteract == null)
        {
            this.InteractWithARandomProp();
            return;
        }
        photonObjectInteract.GetComponent <GhostWriting>().Use();
    }
Example #14
0
        private void SyncDropZone(int viewID)
        {
            if (PhotonView.Find(viewID) == null)
            {
                return;
            }
            PhotonObjectInteract component = PhotonView.Find(viewID).GetComponent <PhotonObjectInteract>();

            if (component == null)
            {
                return;
            }
            if (this.isBeltDropZone && !this.view.isMine)
            {
                component.isGrabbed = true;
            }
            switch (this.snapType)
            {
            case VRTK_SnapDropZone.SnapTypes.UseKinematic:
                component.SaveCurrentState();
                component.GetComponent <Rigidbody>().collisionDetectionMode = CollisionDetectionMode.ContinuousSpeculative;
                component.isKinematic = true;
                break;

            case VRTK_SnapDropZone.SnapTypes.UseJoint:
                this.SetSnapDropZoneJoint(component.GetComponent <Rigidbody>());
                break;

            case VRTK_SnapDropZone.SnapTypes.UseParenting:
                component.SaveCurrentState();
                component.GetComponent <Rigidbody>().collisionDetectionMode = CollisionDetectionMode.ContinuousSpeculative;
                component.isKinematic = true;
                component.transform.SetParent(base.transform);
                if (this.isBeltDropZone)
                {
                    Quaternion localRotation = component.transform.localRotation;
                    localRotation.eulerAngles         = component.localPlayerRotation;
                    component.transform.localRotation = localRotation;
                }
                break;
            }
            this.OnObjectSnappedToDropZone(this.SetSnapDropZoneEvent(component.gameObject));
        }
Example #15
0
 // Token: 0x06000CB2 RID: 3250 RVA: 0x00050E88 File Offset: 0x0004F088
 private void AttemptGrab()
 {
     for (int i = 0; i < this.raycastPoints.Length; i++)
     {
         RaycastHit raycastHit;
         if (Physics.Raycast(this.raycastPoints[i].position, this.raycastPoints[i].forward, out raycastHit, 1.5f, this.mask, QueryTriggerInteraction.Ignore) && raycastHit.collider.GetComponent <Prop>())
         {
             PhotonObjectInteract component = raycastHit.collider.GetComponent <PhotonObjectInteract>();
             if (!component.isGrabbed)
             {
                 if (!component.view.isMine)
                 {
                     component.view.RequestOwnership();
                 }
                 component.transform.position = base.transform.position;
                 this.interactTouch.ForceStopTouching();
                 this.interactTouch.ForceTouch(component.gameObject);
                 this.interactGrab.AttemptGrab();
             }
         }
     }
 }
Example #16
0
        // Token: 0x06001202 RID: 4610 RVA: 0x00067C08 File Offset: 0x00065E08
        protected virtual PhotonObjectInteract ValidSnapObject(GameObject checkObject, bool grabState, bool checkGrabState = true)
        {
            PhotonObjectInteract component = checkObject.GetComponent <PhotonObjectInteract>();

            if (component == null)
            {
                return(null);
            }
            if (VRTK_PolicyList.Check(component.gameObject, this.validObjectListPolicy))
            {
                return(null);
            }
            if (component.view == null)
            {
                return(null);
            }
            if (component.isFixedItem || !component.isProp)
            {
                return(null);
            }
            if (!this.isHeadCamDropZone && component.GetComponent <CCTV>() && component.GetComponent <CCTV>().isHeadCamera)
            {
                return(null);
            }
            if (component.GetComponent <Tripod>())
            {
                return(null);
            }
            if (component.isGrabbed != grabState)
            {
                return(null);
            }
            if (!component.view.isMine)
            {
                return(null);
            }
            return(component);
        }
Example #17
0
        // Token: 0x0600121C RID: 4636 RVA: 0x00068664 File Offset: 0x00066864
        protected virtual void ToggleHighlight(Collider collider, bool state)
        {
            PhotonObjectInteract photonObjectInteract = this.ValidSnapObject(collider.gameObject, true, state);

            if (this.highlightObject != null && photonObjectInteract != null)
            {
                this.highlightObject.SetActive(state);
                photonObjectInteract.SetSnapDropZoneHover(this, state);
                this.willSnap      = state;
                this.isHighlighted = state;
                if (state)
                {
                    if (!this.IsObjectHovering(collider.gameObject) || this.wasSnapped)
                    {
                        this.OnObjectEnteredSnapDropZone(this.SetSnapDropZoneEvent(collider.gameObject));
                    }
                    this.AddCurrentValidSnapObject(collider.gameObject);
                    return;
                }
                this.OnObjectExitedSnapDropZone(this.SetSnapDropZoneEvent(collider.gameObject));
                this.RemoveCurrentValidSnapObject(collider.gameObject);
            }
        }
Example #18
0
    // Token: 0x0600067E RID: 1662 RVA: 0x00024484 File Offset: 0x00022684
    public void InteractWithARandomDoor()
    {
        if (this.ghostAI.ghostInfo.ghostTraits.ghostType == GhostTraits.Type.Shade && LevelController.instance.currentGhostRoom.playersInRoom.Count > 1)
        {
            this.ghostAI.ChangeState(GhostAI.States.favouriteRoom, null, null);
            return;
        }
        PhotonObjectInteract doorToOpen = this.GetDoorToOpen();

        if (doorToOpen == null)
        {
            this.InteractWithARandomProp();
            return;
        }
        if (doorToOpen.GetComponent <Door>())
        {
            if (doorToOpen.GetComponent <Door>().type == Key.KeyType.main)
            {
                if (Random.Range(0, 5) < 3)
                {
                    this.ghostAI.ChangeState(GhostAI.States.door, doorToOpen, null);
                    return;
                }
                this.ghostAI.ChangeState(GhostAI.States.doorKnock, null, null);
                return;
            }
            else
            {
                if (Random.Range(0, 3) < 2)
                {
                    this.ghostAI.ChangeState(GhostAI.States.door, doorToOpen, null);
                    return;
                }
                this.ghostAI.ChangeState(GhostAI.States.lockDoor, doorToOpen, null);
            }
        }
    }
    }                                                                       // Dummy constructor

    public u0920u0929u091Du091Eu0921u0925u0925u0923u0920u091Du091F(GhostAI ghostAI, GhostInteraction ghostInteraction, PhotonObjectInteract obj)
    {
    }                                                                                                                                                   // 0x0000000180C82610-0x0000000180C826B0
Example #20
0
    }                                                                       // Dummy constructor

    public u091Bu091Du0921u0924u0928u091Eu091Bu0920u0928u0926u091B(GhostAI ghostAI, GhostInteraction ghostInteraction, PhotonObjectInteract obj)
    {
    }                                                                                                                                                   // 0x0000000180C1F440-0x0000000180C1F4E0
    }                                                                       // Dummy constructor

    public u091Bu0929u0922u0927u0925u0927u091Cu0921u091Du091Eu0920(GhostAI ghostAI, GhostInteraction ghostInteraction, PhotonObjectInteract obj)
    {
    }                                                                                                                                                   // 0x0000000180C296C0-0x0000000180C29760
    }                                                                       // Dummy constructor

    public u091Au0927u0929u0929u0922u0929u0924u0923u0922u0923u0927(GhostAI ghostAI, GhostInteraction ghostInteraction, PhotonObjectInteract obj)
    {
    }                                                                                                                                                   // 0x00000001818B1D90-0x00000001818B1E30
Example #23
0
 // Token: 0x0600070D RID: 1805 RVA: 0x00029A28 File Offset: 0x00027C28
 public SinkState(GhostAI ghostAI, GhostInteraction ghostInteraction, PhotonObjectInteract obj)
 {
     this.ghostAI          = ghostAI;
     this.ghostInteraction = ghostInteraction;
     this.sink             = obj.GetComponent <Sink>();
 }
Example #24
0
    }                                                                       // Dummy constructor

    public u0924u0927u091Eu0924u091Bu091Bu0921u091Au0921u091Cu0926(GhostAI ghostAI, GhostInteraction ghostInteraction, PhotonObjectInteract obj)
    {
    }                                                                                                                                                   // 0x0000000180B83440-0x0000000180B834E0
Example #25
0
    // Token: 0x06000BD1 RID: 3025 RVA: 0x00049A14 File Offset: 0x00047C14
    public void SwitchHand(int modifier)
    {
        if (this.inventoryProps[this.inventoryIndex])
        {
            if (this.inventoryProps[this.inventoryIndex].GetComponent <CCTV>())
            {
                this.inventoryProps[this.inventoryIndex].GetComponent <CCTV>().TurnOff();
            }
            else if (this.inventoryProps[this.inventoryIndex].GetComponent <EVPRecorder>())
            {
                this.inventoryProps[this.inventoryIndex].GetComponent <EVPRecorder>().TurnOff();
            }
            else if (this.inventoryProps[this.inventoryIndex].GetComponent <EMFReader>())
            {
                if (this.inventoryProps[this.inventoryIndex].GetComponent <EMFReader>().isOn)
                {
                    this.inventoryProps[this.inventoryIndex].GetComponent <EMFReader>().Use();
                }
            }
            else if (this.inventoryProps[this.inventoryIndex].GetComponent <Tripod>())
            {
                this.Drop(true);
            }
            else if (this.inventoryProps[this.inventoryIndex].GetComponent <OuijaBoard>())
            {
                this.Drop(true);
            }
        }
        int index = this.inventoryIndex;

        this.inventoryIndex += modifier;
        if (this.inventoryIndex > this.inventoryProps.Count - 1)
        {
            this.inventoryIndex = 0;
        }
        else if (this.inventoryIndex < 0)
        {
            this.inventoryIndex = this.inventoryProps.Count - 1;
        }
        if (this.inventoryProps[this.inventoryIndex])
        {
            PhotonObjectInteract photonObjectInteract = this.inventoryProps[this.inventoryIndex];
        }
        if (this.inventoryProps[index])
        {
            if (PhotonNetwork.inRoom)
            {
                this.view.RPC("EnableOrDisableObject", PhotonTargets.AllBuffered, new object[]
                {
                    this.inventoryProps[index].view.viewID,
                    false
                });
            }
            else
            {
                this.EnableOrDisableObject(this.inventoryProps[index].view.viewID, false);
            }
        }
        if (this.inventoryProps[this.inventoryIndex])
        {
            if (PhotonNetwork.inRoom)
            {
                this.view.RPC("EnableOrDisableObject", PhotonTargets.AllBuffered, new object[]
                {
                    this.inventoryProps[this.inventoryIndex].view.viewID,
                    true
                });
            }
            else
            {
                this.EnableOrDisableObject(this.inventoryProps[this.inventoryIndex].view.viewID, true);
            }
            this.Grab(this.inventoryProps[this.inventoryIndex]);
            this.player.currentHeldObject = this.inventoryProps[this.inventoryIndex];
            if (this.inventoryProps[this.inventoryIndex].GetComponent <Torch>())
            {
                this.pcFlashlight.EnableOrDisableLight(false, true);
                return;
            }
        }
        else
        {
            this.player.currentHeldObject = null;
        }
    }
Example #26
0
 // Token: 0x060006C6 RID: 1734 RVA: 0x00025C6C File Offset: 0x00023E6C
 public DoorLockState(GhostAI ghostAI, GhostInteraction ghostInteraction, PhotonObjectInteract obj)
 {
     this.ghostAI          = ghostAI;
     this.ghostInteraction = ghostInteraction;
     this.door             = obj.GetComponent <Door>();
 }
Example #27
0
 // Token: 0x06000715 RID: 1813 RVA: 0x00029AF0 File Offset: 0x00027CF0
 public TeleportObjectState(GhostAI ghostAI, GhostInteraction ghostInteraction, PhotonObjectInteract obj)
 {
     this.ghostAI          = ghostAI;
     this.ghostInteraction = ghostInteraction;
     this.teleportObj      = obj.GetComponent <TeleportableObject>();
 }
Example #28
0
 // Token: 0x06000BCC RID: 3020 RVA: 0x0004922C File Offset: 0x0004742C
 private void Grab(PhotonObjectInteract grabbedItem)
 {
     if (this.player.isDead)
     {
         return;
     }
     if (PhotonNetwork.inRoom)
     {
         grabbedItem.view.RequestOwnership();
     }
     grabbedItem.OnPCGrabbed.Invoke();
     if (grabbedItem != null)
     {
         if (this.inventoryProps[this.inventoryIndex] == grabbedItem)
         {
             if (grabbedItem.myRightHandModel != null)
             {
                 grabbedItem.myRightHandModel.SetActive(true);
             }
         }
         else if (PhotonNetwork.inRoom)
         {
             this.view.RPC("EnableOrDisableObject", PhotonTargets.AllBuffered, new object[]
             {
                 grabbedItem.view.viewID,
                 false
             });
         }
         else
         {
             this.EnableOrDisableObject(grabbedItem.view.viewID, false);
         }
         Collider[] components = grabbedItem.GetComponents <Collider>();
         for (int i = 0; i < components.Length; i++)
         {
             components[i].enabled = false;
         }
         this.player.charAnim.SetTrigger("SwitchHolding");
         this.player.charAnim.SetBool("isHolding", true);
         if (PhotonNetwork.inRoom)
         {
             this.view.RPC("NetworkedGrab", PhotonTargets.AllBuffered, new object[]
             {
                 grabbedItem.view.viewID
             });
         }
         Rigidbody component = grabbedItem.GetComponent <Rigidbody>();
         this.grabSpotJoint.connectedBody = component;
         component.collisionDetectionMode = CollisionDetectionMode.ContinuousSpeculative;
         component.isKinematic            = true;
         grabbedItem.transform.SetParent(this.cameraItemSpot);
         if (grabbedItem.GetComponent <Tripod>())
         {
             grabbedItem.transform.localPosition = new Vector3(0f, -0.6f, 0f);
         }
         else
         {
             grabbedItem.transform.localPosition = grabbedItem.localPlayerPosition;
         }
         Quaternion localRotation = grabbedItem.transform.localRotation;
         localRotation.eulerAngles           = grabbedItem.localPlayerRotation;
         grabbedItem.transform.localRotation = localRotation;
     }
 }
Example #29
0
 // Token: 0x06000722 RID: 1826 RVA: 0x00029F0B File Offset: 0x0002810B
 public WindowKnockState(GhostAI ghostAI, GhostInteraction ghostInteraction, PhotonObjectInteract obj)
 {
     this.ghostAI          = ghostAI;
     this.ghostInteraction = ghostInteraction;
     this.window           = obj.GetComponent <Window>();
 }
    }                                                                       // Dummy constructor

    public u0920u0920u0929u0924u091Fu0928u0926u091Eu0923u0921u091F(GhostAI ghostAI, GhostInteraction ghostInteraction, GhostInfo ghostInfo, PhotonObjectInteract obj)
    {
    }                                                                                                                                                                        // 0x0000000180C7F090-0x0000000180C7F150