Пример #1
0
 // Token: 0x06005920 RID: 22816 RVA: 0x001EE5A0 File Offset: 0x001EC9A0
 private void Update()
 {
     if (this.sync != null && base.gameObject.IsReady())
     {
         this.DoSyncUpdate();
     }
     this.UpdateEnableCollisionWithPlayer();
     if (base.transform.position.y < this.DestroyHeightY)
     {
         VRC_SceneDescriptor.RespawnHeightBehaviour respawnHeightBehaviour = this.killBehaviour;
         if (respawnHeightBehaviour != VRC_SceneDescriptor.RespawnHeightBehaviour.Destroy)
         {
             if (respawnHeightBehaviour == VRC_SceneDescriptor.RespawnHeightBehaviour.Respawn)
             {
                 if (this.sync != null)
                 {
                     this.sync.TeleportTo(this.initialLocation, this.initialRotation);
                 }
             }
         }
         else
         {
             VRC.Network.Destroy(base.gameObject);
         }
     }
     if (this.pickup != null && !base.isMine && this.isHeld)
     {
         bool   hidden      = false;
         string ownerUserId = base.OwnerUserId;
         if (ownerUserId != null && ModerationManager.Instance != null && ModerationManager.Instance.IsBlocked(ownerUserId))
         {
             VRCVrCamera instance = VRCVrCamera.GetInstance();
             if (instance != null)
             {
                 float sqrMagnitude = (instance.GetWorldCameraPos() - base.transform.position).sqrMagnitude;
                 if (sqrMagnitude < 2.25f)
                 {
                     hidden = true;
                 }
             }
         }
         this.SetHidden(hidden);
     }
 }
Пример #2
0
    // Token: 0x060056AF RID: 22191 RVA: 0x001DD208 File Offset: 0x001DB608
    public static float GetPlayerSeatedPlayAdjustment(bool recalibrate = false)
    {
        float       x           = VRCTrackingManager.instance.transform.localScale.x;
        float       num         = VRCTracking.DefaultSeatedEye;
        VRCVrCamera vrcvrCamera = VRCVrCamera.GetInstance();
        VRCPlayer   vrcplayer   = VRCPlayer.Instance;

        if (!VRCTrackingManager._usingStationViewPoint && recalibrate && vrcvrCamera != null && vrcplayer != null)
        {
            num  = vrcplayer.transform.InverseTransformPoint(vrcvrCamera.GetWorldCameraPos()).y / x;
            num -= vrcvrCamera.GetLiftAmount();
            VRCTrackingManager.instance.seatedEyePosition = num;
        }
        else
        {
            num = VRCTrackingManager.instance.seatedEyePosition;
        }
        return(VRCTrackingManager.GetAvatarViewPoint().y * 0.96f / x - num);
    }