// Token: 0x06000058 RID: 88 RVA: 0x00003F50 File Offset: 0x00002150
 private void HideObject(global::UnityEngine.Transform t, string name)
 {
     global::UnityEngine.Transform transform = new global::UnityEngine.GameObject(name).transform;
     transform.parent = t.parent;
     t.parent         = transform;
     transform.gameObject.SetActive(false);
 }
 // Token: 0x060005BC RID: 1468 RVA: 0x0001BEB7 File Offset: 0x0001A0B7
 public TravelDistanceRumble(ushort intensity, float distance, global::UnityEngine.Transform transform)
 {
     this.MicroDuration = intensity;
     this._Transform    = transform;
     this._Distance     = distance;
     this.PrevPosition  = transform.position;
 }
Exemplo n.º 3
0
 // Token: 0x06000635 RID: 1589 RVA: 0x0001E09C File Offset: 0x0001C29C
 private void Awake()
 {
     global::EscalationVR.EscalationVRContext context = new global::EscalationVR.EscalationVRContext();
     global::VRGIN.Core.VRManager.Create <global::EscalationVR.EscalationInterpreter>(context);
     global::VRGIN.Core.VR.Manager.SetMode <global::EscalationVR.MasoMode>();
     global::UnityEngine.SceneManagement.SceneManager.activeSceneChanged += delegate(global::UnityEngine.SceneManagement.Scene current, global::UnityEngine.SceneManagement.Scene next)
     {
         global::UnityChanLipSync      lipSync = global::UnityEngine.Object.FindObjectOfType <global::UnityChanLipSync>();
         global::FlagActivator_Skanojo flagActivator_Skanojo = global::UnityEngine.Object.FindObjectOfType <global::FlagActivator_Skanojo>();
         bool flag = lipSync;
         if (flag)
         {
             bool flag2 = !lipSync.audio_.spatialize;
             if (flag2)
             {
                 global::UnityEngine.Debug.Log("SPATIALIZE");
                 global::UnityEngine.Transform        transform         = flagActivator_Skanojo.transform.FindDescendant("Head");
                 global::UnityEngine.AudioSource      audioSource       = global::VRGIN.Helpers.UnityHelper.CopyComponent <global::UnityEngine.AudioSource>(lipSync.audio_, transform.gameObject);
                 global::System.Reflection.MethodInfo onAudioFilterRead = typeof(global::LipSyncCore).GetMethod("OnAudioFilterRead", 36);
                 object[] parameterArray = new object[2];
                 audioSource.gameObject.AddComponent <global::EscalationVR.ForwardAudioEvent>().AudioFilterRead = delegate(float[] p1, int p2)
                 {
                     parameterArray[0] = p1;
                     parameterArray[1] = p2;
                     onAudioFilterRead.Invoke(lipSync, parameterArray);
                 };
                 lipSync.audio_              = audioSource;
                 lipSync.audio_.spatialize   = true;
                 lipSync.audio_.spatialBlend = 1f;
             }
         }
     };
 }
Exemplo n.º 4
0
    // Token: 0x06000089 RID: 137 RVA: 0x0000658C File Offset: 0x0000478C
    private ulong GetOverlayHandle(string overlayName, global::UnityEngine.Transform transform, float widthInMeters = 1f)
    {
        ulong num = 0UL;

        global::Valve.VR.CVROverlay overlay = global::Valve.VR.OpenVR.Overlay;
        bool  flag = overlay == null;
        ulong result;

        if (flag)
        {
            result = num;
        }
        else
        {
            string pchOverlayKey = global::SteamVR_Overlay.key + "." + overlayName;
            global::Valve.VR.EVROverlayError evroverlayError = overlay.FindOverlay(pchOverlayKey, ref num);
            bool flag2 = evroverlayError > global::Valve.VR.EVROverlayError.None;
            if (flag2)
            {
                evroverlayError = overlay.CreateOverlay(pchOverlayKey, overlayName, ref num);
            }
            bool flag3 = evroverlayError == global::Valve.VR.EVROverlayError.None;
            if (flag3)
            {
                overlay.ShowOverlay(num);
                overlay.SetOverlayAlpha(num, this.alpha);
                overlay.SetOverlayWidthInMeters(num, widthInMeters);
                bool flag4 = global::SteamVR.instance.graphicsAPI == global::Valve.VR.EGraphicsAPIConvention.API_DirectX;
                if (flag4)
                {
                    global::Valve.VR.VRTextureBounds_t vrtextureBounds_t = default(global::Valve.VR.VRTextureBounds_t);
                    vrtextureBounds_t.uMin = 0f;
                    vrtextureBounds_t.vMin = 1f;
                    vrtextureBounds_t.uMax = 1f;
                    vrtextureBounds_t.vMax = 0f;
                    overlay.SetOverlayTextureBounds(num, ref vrtextureBounds_t);
                }
                global::SteamVR_Camera steamVR_Camera = (this.loadingScreenDistance == 0f) ? global::SteamVR_Render.Top() : null;
                bool flag5 = steamVR_Camera != null && steamVR_Camera.origin != null;
                if (flag5)
                {
                    global::SteamVR_Utils.RigidTransform rigidTransform = new global::SteamVR_Utils.RigidTransform(steamVR_Camera.origin, transform);
                    rigidTransform.pos.x = rigidTransform.pos.x / steamVR_Camera.origin.localScale.x;
                    rigidTransform.pos.y = rigidTransform.pos.y / steamVR_Camera.origin.localScale.y;
                    rigidTransform.pos.z = rigidTransform.pos.z / steamVR_Camera.origin.localScale.z;
                    global::Valve.VR.HmdMatrix34_t hmdMatrix34_t = rigidTransform.ToHmdMatrix34();
                    overlay.SetOverlayTransformAbsolute(num, global::SteamVR_Render.instance.trackingSpace, ref hmdMatrix34_t);
                }
                else
                {
                    global::Valve.VR.HmdMatrix34_t hmdMatrix34_t2 = new global::SteamVR_Utils.RigidTransform(transform).ToHmdMatrix34();
                    overlay.SetOverlayTransformAbsolute(num, global::SteamVR_Render.instance.trackingSpace, ref hmdMatrix34_t2);
                }
            }
            result = num;
        }
        return(result);
    }
Exemplo n.º 5
0
 // Token: 0x06000585 RID: 1413 RVA: 0x0001B858 File Offset: 0x00019A58
 public static void SendMessageUpwardsToAll(this global::UnityEngine.GameObject gameobject, string methodName, params object[] parameters)
 {
     global::UnityEngine.Transform transform = gameobject.transform;
     while (transform != null)
     {
         transform.gameObject.BroadcastToAll(methodName, parameters);
         transform = transform.parent;
     }
 }
 // Token: 0x06000602 RID: 1538 RVA: 0x0001D378 File Offset: 0x0001B578
 public static global::System.Collections.Generic.IEnumerable <global::UnityEngine.Transform> Ancestors(this global::UnityEngine.Transform transform)
 {
     global::UnityEngine.Transform t = transform;
     while (t.parent)
     {
         t = t.parent;
         yield return(t);
     }
     yield break;
 }
Exemplo n.º 7
0
 // Token: 0x060005E1 RID: 1505 RVA: 0x0001CE80 File Offset: 0x0001B080
 public global::UnityEngine.Quaternion GetBodyOrientation()
 {
     global::UnityEngine.Transform boneTransform  = this._animator.GetBoneTransform(11);
     global::UnityEngine.Transform boneTransform2 = this._animator.GetBoneTransform(12);
     global::UnityEngine.Transform boneTransform3 = this._animator.GetBoneTransform(0);
     global::UnityEngine.Vector3   normalized     = (global::UnityEngine.Vector3.Lerp(boneTransform.position, boneTransform2.position, 0.5f) - boneTransform3.position).normalized;
     global::UnityEngine.Vector3   normalized2    = ((boneTransform2.position - boneTransform.position).normalized + boneTransform3.right).normalized;
     global::UnityEngine.Vector3   vector         = -global::UnityEngine.Vector3.Cross(normalized, normalized2).normalized;
     return(global::UnityEngine.Quaternion.LookRotation(vector, normalized));
 }
Exemplo n.º 8
0
    // Token: 0x06000042 RID: 66 RVA: 0x00003568 File Offset: 0x00001768
    public void Collapse()
    {
        base.transform.parent = null;
        while (this.head.childCount > 0)
        {
            this.head.GetChild(0).parent = base.transform;
        }
        global::UnityEngine.GUILayer component = this.head.GetComponent <global::UnityEngine.GUILayer>();
        bool flag = component != null;

        if (flag)
        {
            global::UnityEngine.Object.DestroyImmediate(component);
            base.gameObject.AddComponent <global::UnityEngine.GUILayer>();
        }
        bool flag2 = this.ears != null;

        if (flag2)
        {
            while (this.ears.childCount > 0)
            {
                this.ears.GetChild(0).parent = base.transform;
            }
            global::UnityEngine.Object.DestroyImmediate(this.ears.gameObject);
            this._ears = null;
            base.gameObject.AddComponent(typeof(global::UnityEngine.AudioListener));
        }
        bool flag3 = this.origin != null;

        if (flag3)
        {
            bool flag4 = this.origin.name.EndsWith(" (origin)");
            if (flag4)
            {
                global::UnityEngine.Transform origin = this.origin;
                while (origin.childCount > 0)
                {
                    origin.GetChild(0).parent = origin.parent;
                }
                global::UnityEngine.Object.DestroyImmediate(origin.gameObject);
            }
            else
            {
                base.transform.parent = this.origin;
            }
        }
        global::UnityEngine.Object.DestroyImmediate(this.head.gameObject);
        this._head = null;
        bool flag5 = base.name.EndsWith(" (eye)");

        if (flag5)
        {
            base.name = base.name.Substring(0, base.name.Length - " (eye)".Length);
        }
    }
    // Token: 0x06000059 RID: 89 RVA: 0x00003F8C File Offset: 0x0000218C
    private void ShowObject(global::UnityEngine.Transform t, string name)
    {
        global::UnityEngine.Transform parent = t.parent;
        bool flag = parent.gameObject.name != name;

        if (!flag)
        {
            t.parent = parent.parent;
            global::UnityEngine.Object.Destroy(parent.gameObject);
        }
    }
Exemplo n.º 10
0
        // Token: 0x0600057A RID: 1402 RVA: 0x0001B45C File Offset: 0x0001965C
        protected override void OnUpdate()
        {
            base.OnUpdate();
            bool flag = this._RootNode && global::VRGIN.Core.VR.Camera.SteamCam.head.transform;

            if (flag)
            {
                global::UnityEngine.Transform transform  = global::VRGIN.Core.VR.Camera.SteamCam.head.transform;
                global::UnityEngine.Vector3   normalized = (transform.position - this._RootNode.position).normalized;
                this.Target.transform.position = transform.position + normalized * this.Offset;
            }
        }
Exemplo n.º 11
0
 // Token: 0x0600042E RID: 1070 RVA: 0x00015084 File Offset: 0x00013284
 public static global::VRGIN.Controls.HelpText Create(string text, global::UnityEngine.Transform target, global::UnityEngine.Vector3 textOffset, global::UnityEngine.Vector3?lineOffset = null)
 {
     global::VRGIN.Controls.HelpText helpText = new global::UnityEngine.GameObject().AddComponent <global::VRGIN.Controls.HelpText>();
     helpText._Text       = text;
     helpText._Target     = target;
     helpText._TextOffset = textOffset;
     helpText._LineOffset = ((lineOffset != null) ? lineOffset.Value : global::UnityEngine.Vector3.zero);
     global::UnityEngine.Vector3 vector = (lineOffset != null) ? (textOffset - lineOffset.Value) : textOffset;
     helpText._HeightVector   = global::UnityEngine.Vector3.Project(vector, global::UnityEngine.Vector3.up);
     helpText._MovementVector = global::UnityEngine.Vector3.ProjectOnPlane(vector, global::UnityEngine.Vector3.up);
     return(helpText);
 }
Exemplo n.º 12
0
    // Token: 0x06000065 RID: 101 RVA: 0x0000472C File Offset: 0x0000292C
    public void AttachToCamera(global::SteamVR_Camera vrcam)
    {
        bool flag = this.target == vrcam.head;

        if (!flag)
        {
            this.target = vrcam.head;
            global::UnityEngine.Transform parent  = base.transform.parent;
            global::UnityEngine.Transform parent2 = vrcam.head.parent;
            parent.parent        = parent2;
            parent.localPosition = global::UnityEngine.Vector3.zero;
            parent.localRotation = global::UnityEngine.Quaternion.identity;
            parent.localScale    = global::UnityEngine.Vector3.one;
            vrcam.enabled        = false;
            global::UnityEngine.GameObject gameObject = global::UnityEngine.Object.Instantiate <global::UnityEngine.GameObject>(vrcam.gameObject);
            vrcam.enabled   = true;
            gameObject.name = "camera";
            global::UnityEngine.Object.DestroyImmediate(gameObject.GetComponent <global::SteamVR_Camera>());
            global::UnityEngine.Object.DestroyImmediate(gameObject.GetComponent <global::SteamVR_CameraFlip>());
            this.cam                     = gameObject.GetComponent <global::UnityEngine.Camera>();
            this.cam.fieldOfView         = this.config.fov;
            this.cam.useOcclusionCulling = false;
            this.cam.enabled             = false;
            this.colorMat                = new global::UnityEngine.Material(global::EscalationVR.UnityHelper.GetShader("Custom/SteamVR_ColorOut"));
            this.alphaMat                = new global::UnityEngine.Material(global::EscalationVR.UnityHelper.GetShader("Custom/SteamVR_AlphaOut"));
            this.clipMaterial            = new global::UnityEngine.Material(global::EscalationVR.UnityHelper.GetShader("Custom/SteamVR_ClearAll"));
            global::UnityEngine.Transform transform = gameObject.transform;
            transform.parent        = base.transform;
            transform.localPosition = new global::UnityEngine.Vector3(this.config.x, this.config.y, this.config.z);
            transform.localRotation = global::UnityEngine.Quaternion.Euler(this.config.rx, this.config.ry, this.config.rz);
            transform.localScale    = global::UnityEngine.Vector3.one;
            while (transform.childCount > 0)
            {
                global::UnityEngine.Object.DestroyImmediate(transform.GetChild(0).gameObject);
            }
            this.clipQuad      = global::UnityEngine.GameObject.CreatePrimitive(5);
            this.clipQuad.name = "ClipQuad";
            global::UnityEngine.Object.DestroyImmediate(this.clipQuad.GetComponent <global::UnityEngine.MeshCollider>());
            global::UnityEngine.MeshRenderer component = this.clipQuad.GetComponent <global::UnityEngine.MeshRenderer>();
            component.material             = this.clipMaterial;
            component.shadowCastingMode    = 0;
            component.receiveShadows       = false;
            component.useLightProbes       = false;
            component.reflectionProbeUsage = 0;
            global::UnityEngine.Transform transform2 = this.clipQuad.transform;
            transform2.parent        = transform;
            transform2.localScale    = new global::UnityEngine.Vector3(1000f, 1000f, 1f);
            transform2.localRotation = global::UnityEngine.Quaternion.identity;
            this.clipQuad.SetActive(false);
        }
    }
Exemplo n.º 13
0
 // Token: 0x060000CB RID: 203 RVA: 0x00009254 File Offset: 0x00007454
 public global::UnityEngine.Transform FindComponent(string componentName)
 {
     global::UnityEngine.Transform transform = base.transform;
     for (int i = 0; i < transform.childCount; i++)
     {
         global::UnityEngine.Transform child = transform.GetChild(i);
         bool flag = child.name == componentName;
         if (flag)
         {
             return(child);
         }
     }
     return(null);
 }
Exemplo n.º 14
0
        // Token: 0x0600042C RID: 1068 RVA: 0x00015000 File Offset: 0x00013200
        public global::UnityEngine.Transform FindAttachPosition(params string[] names)
        {
            global::UnityEngine.Transform transform = global::System.Linq.Enumerable.FirstOrDefault <global::UnityEngine.Transform>(global::System.Linq.Enumerable.Where <global::UnityEngine.Transform>(base.transform.GetComponentsInChildren <global::UnityEngine.Transform>(), (global::UnityEngine.Transform t) => global::System.Linq.Enumerable.Contains <string>(names, t.name)));
            bool flag = transform == null;

            global::UnityEngine.Transform result;
            if (flag)
            {
                result = null;
            }
            else
            {
                result = transform.Find("attach");
            }
            return(result);
        }
Exemplo n.º 15
0
        // Token: 0x060002C4 RID: 708 RVA: 0x00010A74 File Offset: 0x0000EC74
        public GuiScaler(global::VRGIN.Visuals.GUIQuad gui, global::UnityEngine.Transform left, global::UnityEngine.Transform right)
        {
            this._Gui                     = gui;
            this._Left                    = left;
            this._Right                   = right;
            this._StartLeft               = new global::UnityEngine.Vector3?(left.position);
            this._StartRight              = new global::UnityEngine.Vector3?(right.position);
            this._StartScale              = new global::UnityEngine.Vector3?(this._Gui.transform.localScale);
            this._StartRotation           = new global::UnityEngine.Quaternion?(this._Gui.transform.localRotation);
            this._StartPosition           = new global::UnityEngine.Vector3?(this._Gui.transform.position);
            this._StartRotationController = this.GetAverageRotation();
            float num = global::UnityEngine.Vector3.Distance(this._StartLeft.Value, this._StartRight.Value);

            global::UnityEngine.Vector3 vector  = this._StartRight.Value - this._StartLeft.Value;
            global::UnityEngine.Vector3 vector2 = this._StartLeft.Value + vector * 0.5f;
            this._OffsetFromCenter = new global::UnityEngine.Vector3?(this._Gui.transform.position - vector2);
        }
Exemplo n.º 16
0
    // Token: 0x060000D1 RID: 209 RVA: 0x000096E4 File Offset: 0x000078E4
    public void UpdateComponents()
    {
        global::UnityEngine.Transform transform = base.transform;
        bool flag = transform.childCount == 0;

        if (!flag)
        {
            using (global::SteamVR_RenderModel.RenderModelInterfaceHolder renderModelInterfaceHolder = new global::SteamVR_RenderModel.RenderModelInterfaceHolder())
            {
                global::Valve.VR.VRControllerState_t vrcontrollerState_t = (this.index != global::SteamVR_TrackedObject.EIndex.None) ? global::SteamVR_Controller.Input((int)this.index).GetState() : default(global::Valve.VR.VRControllerState_t);
                for (int i = 0; i < transform.childCount; i++)
                {
                    global::UnityEngine.Transform    child    = transform.GetChild(i);
                    global::Valve.VR.CVRRenderModels instance = renderModelInterfaceHolder.instance;
                    bool flag2 = instance == null;
                    if (flag2)
                    {
                        break;
                    }
                    global::Valve.VR.RenderModel_ComponentState_t renderModel_ComponentState_t = default(global::Valve.VR.RenderModel_ComponentState_t);
                    bool flag3 = !instance.GetComponentState(this.renderModelName, child.name, ref vrcontrollerState_t, ref this.controllerModeState, ref renderModel_ComponentState_t);
                    if (!flag3)
                    {
                        global::SteamVR_Utils.RigidTransform rigidTransform = new global::SteamVR_Utils.RigidTransform(renderModel_ComponentState_t.mTrackingToComponentRenderModel);
                        child.localPosition = rigidTransform.pos;
                        child.localRotation = rigidTransform.rot;
                        global::UnityEngine.Transform transform2 = child.FindChild("attach");
                        bool flag4 = transform2 != null;
                        if (flag4)
                        {
                            global::SteamVR_Utils.RigidTransform rigidTransform2 = new global::SteamVR_Utils.RigidTransform(renderModel_ComponentState_t.mTrackingToComponentLocal);
                            transform2.position = transform.TransformPoint(rigidTransform2.pos);
                            transform2.rotation = transform.rotation * rigidTransform2.rot;
                        }
                        bool flag5 = (renderModel_ComponentState_t.uProperties & 2U) > 0U;
                        bool flag6 = flag5 != child.gameObject.activeSelf;
                        if (flag6)
                        {
                            child.gameObject.SetActive(flag5);
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 17
0
    // Token: 0x06000066 RID: 102 RVA: 0x000049B8 File Offset: 0x00002BB8
    public float GetTargetDistance()
    {
        bool  flag = this.target == null;
        float result;

        if (flag)
        {
            result = this.config.near + 0.01f;
        }
        else
        {
            global::UnityEngine.Transform transform  = this.cam.transform;
            global::UnityEngine.Vector3   normalized = new global::UnityEngine.Vector3(transform.forward.x, 0f, transform.forward.z).normalized;
            global::UnityEngine.Vector3   vector     = this.target.position + new global::UnityEngine.Vector3(this.target.forward.x, 0f, this.target.forward.z).normalized *this.config.hmdOffset;
            float num = -new global::UnityEngine.Plane(normalized, vector).GetDistanceToPoint(transform.position);
            result = global::UnityEngine.Mathf.Clamp(num, this.config.near + 0.01f, this.config.far - 0.01f);
        }
        return(result);
    }
Exemplo n.º 18
0
 // Token: 0x060004AF RID: 1199 RVA: 0x000180E8 File Offset: 0x000162E8
 private void OnRenderModelLoaded()
 {
     try
     {
         bool flag = !this._Controller;
         if (flag)
         {
             this._Controller = base.GetComponent <global::VRGIN.Controls.Controller>();
         }
         global::UnityEngine.Transform transform = this._Controller.FindAttachPosition(new string[]
         {
             "tip"
         });
         bool flag2 = !transform;
         if (flag2)
         {
             global::VRGIN.Core.VRLog.Error("Attach position not found for laser!", global::System.Array.Empty <object>());
             transform = base.transform;
         }
         this.Laser = new global::UnityEngine.GameObject().AddComponent <global::UnityEngine.LineRenderer>();
         this.Laser.transform.SetParent(transform, false);
         this.Laser.material              = global::UnityEngine.Resources.GetBuiltinResource <global::UnityEngine.Material>("Sprites-Default.mat");
         this.Laser.material.renderQueue += 5000;
         this.Laser.SetColors(global::UnityEngine.Color.cyan, global::UnityEngine.Color.cyan);
         bool flag3 = global::SteamVR.instance.hmd_TrackingSystemName == "lighthouse";
         if (flag3)
         {
             this.Laser.transform.localRotation = global::UnityEngine.Quaternion.Euler(60f, 0f, 0f);
             this.Laser.transform.position     += this.Laser.transform.forward * 0.06f;
         }
         this.Laser.SetVertexCount(2);
         this.Laser.useWorldSpace = true;
         this.Laser.SetWidth(0.002f, 0.002f);
     }
     catch (global::System.Exception obj)
     {
         global::VRGIN.Core.VRLog.Error(obj);
     }
 }
Exemplo n.º 19
0
 // Token: 0x060005C1 RID: 1473 RVA: 0x0001BF44 File Offset: 0x0001A144
 public AxisBoundTravelDistanceRumble(ushort intensity, float distance, global::UnityEngine.Transform transform, global::UnityEngine.Vector3 axis) : base(intensity, distance, transform)
 {
     this._Axis = axis;
 }
Exemplo n.º 20
0
 // Token: 0x060005CE RID: 1486 RVA: 0x0001C348 File Offset: 0x0001A548
 public static global::UnityEngine.Transform CreateGameObjectAsChild(string name, global::UnityEngine.Transform parent, bool dontDestroy = false)
 {
     global::UnityEngine.GameObject gameObject = new global::UnityEngine.GameObject(name);
     gameObject.transform.SetParent(parent, false);
     if (dontDestroy)
     {
         global::UnityEngine.Object.DontDestroyOnLoad(gameObject);
     }
     return(gameObject.transform);
 }
Exemplo n.º 21
0
 // Token: 0x06000060 RID: 96 RVA: 0x00004340 File Offset: 0x00002540
 private void OnNewPosesApplied(params object[] args)
 {
     global::UnityEngine.Transform  origin     = this.vrcam.origin;
     global::UnityEngine.Quaternion quaternion = (origin != null) ? origin.rotation : global::UnityEngine.Quaternion.identity;
     base.transform.rotation = quaternion * this.offset;
 }
Exemplo n.º 22
0
    // Token: 0x06000041 RID: 65 RVA: 0x00003254 File Offset: 0x00001454
    public void Expand()
    {
        global::UnityEngine.Transform transform = base.transform.parent;
        bool flag = transform == null;

        if (flag)
        {
            transform = new global::UnityEngine.GameObject(base.name + " (origin)").transform;
            transform.localPosition = base.transform.localPosition;
            transform.localRotation = base.transform.localRotation;
            transform.localScale    = base.transform.localScale;
        }
        bool flag2 = this.head == null;

        if (flag2)
        {
            this._head = new global::UnityEngine.GameObject(base.name + " (head)", new global::System.Type[]
            {
                typeof(global::SteamVR_GameView),
                typeof(global::SteamVR_TrackedObject)
            }).transform;
            this.head.parent     = transform;
            this.head.position   = base.transform.position;
            this.head.rotation   = base.transform.rotation;
            this.head.localScale = global::UnityEngine.Vector3.one;
            this.head.tag        = base.tag;
            global::UnityEngine.Camera component = this.head.GetComponent <global::UnityEngine.Camera>();
            component.clearFlags          = 4;
            component.cullingMask         = 0;
            component.eventMask           = 0;
            component.orthographic        = true;
            component.orthographicSize    = 1f;
            component.nearClipPlane       = 0f;
            component.farClipPlane        = 1f;
            component.useOcclusionCulling = false;
        }
        bool flag3 = base.transform.parent != this.head;

        if (flag3)
        {
            base.transform.parent        = this.head;
            base.transform.localPosition = global::UnityEngine.Vector3.zero;
            base.transform.localRotation = global::UnityEngine.Quaternion.identity;
            base.transform.localScale    = global::UnityEngine.Vector3.one;
            while (base.transform.childCount > 0)
            {
                base.transform.GetChild(0).parent = this.head;
            }
            global::UnityEngine.GUILayer component2 = base.GetComponent <global::UnityEngine.GUILayer>();
            bool flag4 = component2 != null;
            if (flag4)
            {
                global::UnityEngine.Object.DestroyImmediate(component2);
                this.head.gameObject.AddComponent <global::UnityEngine.GUILayer>();
            }
            global::UnityEngine.AudioListener component3 = base.GetComponent <global::UnityEngine.AudioListener>();
            bool flag5 = component3 != null;
            if (flag5)
            {
                global::UnityEngine.Object.DestroyImmediate(component3);
                this._ears = new global::UnityEngine.GameObject(base.name + " (ears)", new global::System.Type[]
                {
                    typeof(global::SteamVR_Ears)
                }).transform;
                this.ears.parent        = this._head;
                this.ears.localPosition = global::UnityEngine.Vector3.zero;
                this.ears.localRotation = global::UnityEngine.Quaternion.identity;
                this.ears.localScale    = global::UnityEngine.Vector3.one;
            }
        }
        bool flag6 = !base.name.EndsWith(" (eye)");

        if (flag6)
        {
            base.name += " (eye)";
        }
    }
Exemplo n.º 23
0
    // Token: 0x0600007D RID: 125 RVA: 0x00005BB0 File Offset: 0x00003DB0
    private void LateUpdate()
    {
        bool flag = this.blendPct < 0.001f;

        if (!flag)
        {
            global::UnityEngine.Vector3    vector    = this.upVector ? this.upVector.up : global::UnityEngine.Vector3.Cross(this.end.position - this.start.position, this.joint.position - this.start.position).normalized;
            global::UnityEngine.Vector3    position  = this.target.position;
            global::UnityEngine.Quaternion rotation  = this.target.rotation;
            global::UnityEngine.Vector3    position2 = this.joint.position;
            global::UnityEngine.Vector3    vector2;
            global::UnityEngine.Vector3    vector3;
            global::SteamVR_IK.Solve(this.start.position, position, this.poleVector.position, (this.joint.position - this.start.position).magnitude, (this.end.position - this.joint.position).magnitude, ref position2, out vector2, out vector3);
            bool flag2 = vector3 == global::UnityEngine.Vector3.zero;
            if (!flag2)
            {
                global::UnityEngine.Vector3    position3      = this.start.position;
                global::UnityEngine.Vector3    position4      = this.joint.position;
                global::UnityEngine.Vector3    position5      = this.end.position;
                global::UnityEngine.Quaternion localRotation  = this.start.localRotation;
                global::UnityEngine.Quaternion localRotation2 = this.joint.localRotation;
                global::UnityEngine.Quaternion localRotation3 = this.end.localRotation;
                global::UnityEngine.Transform  parent         = this.start.parent;
                global::UnityEngine.Transform  parent2        = this.joint.parent;
                global::UnityEngine.Transform  parent3        = this.end.parent;
                global::UnityEngine.Vector3    localScale     = this.start.localScale;
                global::UnityEngine.Vector3    localScale2    = this.joint.localScale;
                global::UnityEngine.Vector3    localScale3    = this.end.localScale;
                bool flag3 = this.startXform == null;
                if (flag3)
                {
                    this.startXform        = new global::UnityEngine.GameObject("startXform").transform;
                    this.startXform.parent = base.transform;
                }
                this.startXform.position = position3;
                this.startXform.LookAt(this.joint, vector);
                this.start.parent = this.startXform;
                bool flag4 = this.jointXform == null;
                if (flag4)
                {
                    this.jointXform        = new global::UnityEngine.GameObject("jointXform").transform;
                    this.jointXform.parent = this.startXform;
                }
                this.jointXform.position = position4;
                this.jointXform.LookAt(this.end, vector);
                this.joint.parent = this.jointXform;
                bool flag5 = this.endXform == null;
                if (flag5)
                {
                    this.endXform        = new global::UnityEngine.GameObject("endXform").transform;
                    this.endXform.parent = this.jointXform;
                }
                this.endXform.position = position5;
                this.end.parent        = this.endXform;
                this.startXform.LookAt(position2, vector3);
                this.jointXform.LookAt(position, vector3);
                this.endXform.rotation = rotation;
                this.start.parent      = parent;
                this.joint.parent      = parent2;
                this.end.parent        = parent3;
                this.end.rotation      = rotation;
                bool flag6 = this.blendPct < 1f;
                if (flag6)
                {
                    this.start.localRotation = global::UnityEngine.Quaternion.Slerp(localRotation, this.start.localRotation, this.blendPct);
                    this.joint.localRotation = global::UnityEngine.Quaternion.Slerp(localRotation2, this.joint.localRotation, this.blendPct);
                    this.end.localRotation   = global::UnityEngine.Quaternion.Slerp(localRotation3, this.end.localRotation, this.blendPct);
                }
                this.start.localScale = localScale;
                this.joint.localScale = localScale2;
                this.end.localScale   = localScale3;
            }
        }
    }
Exemplo n.º 24
0
 // Token: 0x06000579 RID: 1401 RVA: 0x0001B42F File Offset: 0x0001962F
 private void CreateTarget()
 {
     this.Target = new global::UnityEngine.GameObject("VRGIN_LookTarget").transform;
     global::UnityEngine.Object.DontDestroyOnLoad(this.Target.gameObject);
 }
Exemplo n.º 25
0
 // Token: 0x06000603 RID: 1539 RVA: 0x0001D388 File Offset: 0x0001B588
 public static int Depth(this global::UnityEngine.Transform transform)
 {
     return(global::System.Linq.Enumerable.Count <global::UnityEngine.Transform>(transform.Ancestors()));
 }
Exemplo n.º 26
0
 // Token: 0x06000605 RID: 1541 RVA: 0x0001D3B8 File Offset: 0x0001B5B8
 public static global::System.Collections.Generic.IEnumerable <global::UnityEngine.Transform> Descendants(this global::UnityEngine.Transform transform)
 {
     return(global::System.Linq.Enumerable.Select <global::UnityEngine.GameObject, global::UnityEngine.Transform>(transform.gameObject.Descendants(), (global::UnityEngine.GameObject d) => d.transform));
 }
Exemplo n.º 27
0
 // Token: 0x06000606 RID: 1542 RVA: 0x0001D3FC File Offset: 0x0001B5FC
 public static global::UnityEngine.Transform FindDescendant(this global::UnityEngine.Transform transform, string name)
 {
     return(global::System.Linq.Enumerable.FirstOrDefault <global::UnityEngine.Transform>(transform.Descendants(), (global::UnityEngine.Transform d) => d.name == name));
 }
Exemplo n.º 28
0
 // Token: 0x06000607 RID: 1543 RVA: 0x0001D434 File Offset: 0x0001B634
 public static global::UnityEngine.Transform FindDescendant(this global::UnityEngine.Transform transform, global::System.Text.RegularExpressions.Regex name)
 {
     return(global::System.Linq.Enumerable.FirstOrDefault <global::UnityEngine.Transform>(transform.Descendants(), (global::UnityEngine.Transform d) => name.IsMatch(d.name)));
 }
Exemplo n.º 29
0
        // Token: 0x06000601 RID: 1537 RVA: 0x0001D368 File Offset: 0x0001B568
        public static global::System.Collections.Generic.IEnumerable <global::UnityEngine.Transform> Children(this global::UnityEngine.Transform transform)
        {
            int num;

            for (int i = 0; i < transform.childCount; i = num + 1)
            {
                yield return(transform.GetChild(i));

                num = i;
            }
            yield break;
        }
Exemplo n.º 30
0
    // Token: 0x06000067 RID: 103 RVA: 0x00004AC0 File Offset: 0x00002CC0
    public void RenderNear()
    {
        int  num  = global::UnityEngine.Screen.width / 2;
        int  num2 = global::UnityEngine.Screen.height / 2;
        bool flag = this.cam.targetTexture == null || this.cam.targetTexture.width != num || this.cam.targetTexture.height != num2;

        if (flag)
        {
            this.cam.targetTexture = new global::UnityEngine.RenderTexture(num, num2, 24, 0);
            this.cam.targetTexture.antiAliasing = ((global::UnityEngine.QualitySettings.antiAliasing == 0) ? 1 : global::UnityEngine.QualitySettings.antiAliasing);
        }
        this.cam.nearClipPlane = this.config.near;
        this.cam.farClipPlane  = this.config.far;
        global::UnityEngine.CameraClearFlags clearFlags      = this.cam.clearFlags;
        global::UnityEngine.Color            backgroundColor = this.cam.backgroundColor;
        this.cam.clearFlags      = 2;
        this.cam.backgroundColor = global::UnityEngine.Color.clear;
        float num3 = global::UnityEngine.Mathf.Clamp(this.GetTargetDistance() + this.config.nearOffset, this.config.near, this.config.far);

        global::UnityEngine.Transform parent = this.clipQuad.transform.parent;
        this.clipQuad.transform.position = parent.position + parent.forward * num3;
        global::UnityEngine.MonoBehaviour[] array = null;
        bool[] array2 = null;
        bool   disableStandardAssets = this.config.disableStandardAssets;

        if (disableStandardAssets)
        {
            array  = this.cam.gameObject.GetComponents <global::UnityEngine.MonoBehaviour>();
            array2 = new bool[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                global::UnityEngine.MonoBehaviour monoBehaviour = array[i];
                bool flag2 = monoBehaviour.enabled && monoBehaviour.GetType().ToString().StartsWith("UnityStandardAssets.");
                if (flag2)
                {
                    monoBehaviour.enabled = false;
                    array2[i]             = true;
                }
            }
        }
        this.clipQuad.SetActive(true);
        this.cam.Render();
        this.clipQuad.SetActive(false);
        bool flag3 = array != null;

        if (flag3)
        {
            for (int j = 0; j < array.Length; j++)
            {
                bool flag4 = array2[j];
                if (flag4)
                {
                    array[j].enabled = true;
                }
            }
        }
        this.cam.clearFlags      = clearFlags;
        this.cam.backgroundColor = backgroundColor;
        global::UnityEngine.Graphics.DrawTexture(new global::UnityEngine.Rect(0f, 0f, (float)num, (float)num2), this.cam.targetTexture, this.colorMat);
        global::UnityEngine.Graphics.DrawTexture(new global::UnityEngine.Rect((float)num, 0f, (float)num, (float)num2), this.cam.targetTexture, this.alphaMat);
    }