// Token: 0x06000057 RID: 87 RVA: 0x00003E48 File Offset: 0x00002048
    private void OnInputFocus(params object[] args)
    {
        bool flag  = (bool)args[0];
        bool flag2 = flag;

        if (flag2)
        {
            for (int i = 0; i < this.objects.Length; i++)
            {
                global::UnityEngine.GameObject gameObject = this.objects[i];
                bool flag3 = gameObject != null;
                if (flag3)
                {
                    string text = (i < 2) ? global::SteamVR_ControllerManager.labels[i] : (i - 1).ToString();
                    this.ShowObject(gameObject.transform, "hidden (" + text + ")");
                }
            }
        }
        else
        {
            for (int j = 0; j < this.objects.Length; j++)
            {
                global::UnityEngine.GameObject gameObject2 = this.objects[j];
                bool flag4 = gameObject2 != null;
                if (flag4)
                {
                    string text2 = (j < 2) ? global::SteamVR_ControllerManager.labels[j] : (j - 1).ToString();
                    this.HideObject(gameObject2.transform, "hidden (" + text2 + ")");
                }
            }
        }
    }
 // 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);
 }
Example #3
0
 // Token: 0x06000246 RID: 582 RVA: 0x0000E368 File Offset: 0x0000C568
 protected override void OnAwake()
 {
     global::UnityEngine.GameObject gameObject = global::UnityEngine.GameObject.CreatePrimitive(0);
     gameObject.transform.SetParent(base.transform, false);
     global::UnityEngine.GameObject gameObject2 = global::UnityEngine.GameObject.CreatePrimitive(0);
     gameObject2.transform.SetParent(base.transform, false);
     base.transform.localScale           = 0.3f * global::UnityEngine.Vector3.one;
     base.transform.localScale           = new global::UnityEngine.Vector3(0.2f, 0.2f, 0.4f);
     gameObject.transform.localScale     = global::UnityEngine.Vector3.one * 0.3f;
     gameObject.transform.localPosition  = global::UnityEngine.Vector3.forward * 0.5f;
     gameObject2.transform.localScale    = global::UnityEngine.Vector3.one * 0.3f;
     gameObject2.transform.localPosition = global::UnityEngine.Vector3.up * 0.5f;
     base.GetComponent <global::UnityEngine.Collider>().isTrigger = true;
     this.model = new global::UnityEngine.GameObject("Model").AddComponent <global::SteamVR_RenderModel>();
     this.model.transform.SetParent(global::VRGIN.Core.VR.Camera.SteamCam.head, false);
     this.model.shader = global::VRGIN.Core.VR.Context.Materials.StandardShader;
     this.model.SetDeviceIndex(0);
     this.model.gameObject.layer = global::UnityEngine.LayerMask.NameToLayer(global::VRGIN.Core.VR.Context.InvisibleLayer);
     global::UnityEngine.Camera camera = base.gameObject.AddComponent <global::UnityEngine.Camera>();
     camera.depth            = 1f;
     camera.nearClipPlane    = 0.3f;
     camera.cullingMask      = (int.MaxValue & ~global::VRGIN.Core.VR.Context.UILayerMask);
     base.transform.position = global::VRGIN.Visuals.PlayerCamera.S_Position;
     base.transform.rotation = global::VRGIN.Visuals.PlayerCamera.S_Rotation;
 }
 // Token: 0x06000055 RID: 85 RVA: 0x00003D14 File Offset: 0x00001F14
 private void OnEnable()
 {
     for (int i = 0; i < this.objects.Length; i++)
     {
         global::UnityEngine.GameObject gameObject = this.objects[i];
         bool flag = gameObject != null;
         if (flag)
         {
             gameObject.SetActive(false);
         }
     }
     this.OnTrackedDeviceRoleChanged(global::System.Array.Empty <object>());
     for (int j = 0; j < global::SteamVR.connected.Length; j++)
     {
         bool flag2 = global::SteamVR.connected[j];
         if (flag2)
         {
             this.OnDeviceConnected(new object[]
             {
                 j,
                 true
             });
         }
     }
     global::SteamVR_Utils.Event.Listen("input_focus", new global::SteamVR_Utils.Event.Handler(this.OnInputFocus));
     global::SteamVR_Utils.Event.Listen("device_connected", new global::SteamVR_Utils.Event.Handler(this.OnDeviceConnected));
     global::SteamVR_Utils.Event.Listen("TrackedDeviceRoleChanged", new global::SteamVR_Utils.Event.Handler(this.OnTrackedDeviceRoleChanged));
 }
 // Token: 0x06000581 RID: 1409 RVA: 0x0001B7C8 File Offset: 0x000199C8
 public static void BroadcastToAll(this global::UnityEngine.GameObject gameobject, string methodName, params object[] parameters)
 {
     global::UnityEngine.MonoBehaviour[] components = gameobject.GetComponents <global::UnityEngine.MonoBehaviour>();
     foreach (global::UnityEngine.MonoBehaviour objectToCheck in components)
     {
         objectToCheck.InvokeIfExists(methodName, parameters);
     }
 }
 // Token: 0x06000583 RID: 1411 RVA: 0x0001B810 File Offset: 0x00019A10
 public static void SendMessageToAll(this global::UnityEngine.GameObject gameobject, string methodName, params object[] parameters)
 {
     global::UnityEngine.MonoBehaviour[] componentsInChildren = gameobject.GetComponentsInChildren <global::UnityEngine.MonoBehaviour>(true);
     foreach (global::UnityEngine.MonoBehaviour objectToCheck in componentsInChildren)
     {
         objectToCheck.InvokeIfExists(methodName, parameters);
     }
 }
 // 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;
     }
 }
Example #8
0
    // Token: 0x0600003F RID: 63 RVA: 0x0000301C File Offset: 0x0000121C
    public void ForceLast()
    {
        bool flag = global::SteamVR_Camera.values != null;

        if (flag)
        {
            foreach (object obj in global::SteamVR_Camera.values)
            {
                global::System.Collections.DictionaryEntry dictionaryEntry = (global::System.Collections.DictionaryEntry)obj;
                global::System.Reflection.FieldInfo        fieldInfo       = dictionaryEntry.Key as global::System.Reflection.FieldInfo;
                fieldInfo.SetValue(this, dictionaryEntry.Value);
            }
            global::SteamVR_Camera.values = null;
        }
        else
        {
            global::UnityEngine.Component[] components = base.GetComponents <global::UnityEngine.Component>();
            for (int i = 0; i < components.Length; i++)
            {
                global::SteamVR_Camera steamVR_Camera = components[i] as global::SteamVR_Camera;
                bool flag2 = steamVR_Camera != null && steamVR_Camera != this;
                if (flag2)
                {
                    bool flag3 = steamVR_Camera.flip != null;
                    if (flag3)
                    {
                        global::UnityEngine.Object.DestroyImmediate(steamVR_Camera.flip);
                    }
                    global::UnityEngine.Object.DestroyImmediate(steamVR_Camera);
                }
            }
            components = base.GetComponents <global::UnityEngine.Component>();
            bool flag4 = this != components[components.Length - 1] || this.flip == null;
            if (flag4)
            {
                bool flag5 = this.flip == null;
                if (flag5)
                {
                    this.flip = base.gameObject.AddComponent <global::SteamVR_CameraFlip>();
                }
                global::SteamVR_Camera.values = new global::System.Collections.Hashtable();
                global::System.Reflection.FieldInfo[] fields = base.GetType().GetFields(52);
                foreach (global::System.Reflection.FieldInfo fieldInfo2 in fields)
                {
                    bool flag6 = fieldInfo2.IsPublic || fieldInfo2.IsDefined(typeof(global::UnityEngine.SerializeField), true);
                    if (flag6)
                    {
                        global::SteamVR_Camera.values[fieldInfo2] = fieldInfo2.GetValue(this);
                    }
                }
                global::UnityEngine.GameObject gameObject = base.gameObject;
                global::UnityEngine.Object.DestroyImmediate(this);
                gameObject.AddComponent <global::SteamVR_Camera>().ForceLast();
            }
        }
    }
Example #9
0
        // Token: 0x06000587 RID: 1415 RVA: 0x0001B8A4 File Offset: 0x00019AA4
        public static void FindHotPaths(global::VRGIN.Helpers.Profiler.Callback callback)
        {
            bool flag = !global::UnityEngine.GameObject.Find("Profiler");

            if (flag)
            {
                global::VRGIN.Helpers.Profiler profiler = new global::UnityEngine.GameObject("Profiler").AddComponent <global::VRGIN.Helpers.Profiler>();
                profiler._Callback = callback;
            }
        }
Example #10
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);
 }
    // Token: 0x06000085 RID: 133 RVA: 0x00006290 File Offset: 0x00004490
    public static void Begin(string levelName, bool showGrid = false, float fadeOutTime = 0.5f, float r = 0f, float g = 0f, float b = 0f, float a = 1f)
    {
        global::SteamVR_LoadLevel steamVR_LoadLevel = new global::UnityEngine.GameObject("loader").AddComponent <global::SteamVR_LoadLevel>();

        steamVR_LoadLevel.levelName       = levelName;
        steamVR_LoadLevel.showGrid        = showGrid;
        steamVR_LoadLevel.fadeOutTime     = fadeOutTime;
        steamVR_LoadLevel.backgroundColor = new global::UnityEngine.Color(r, g, b, a);
        steamVR_LoadLevel.Trigger();
    }
Example #12
0
        // Token: 0x060002BA RID: 698 RVA: 0x00010880 File Offset: 0x0000EA80
        internal static global::VRGIN.U46.Visuals.PlayAreaVisualization Create(global::VRGIN.Core.PlayArea playArea = null)
        {
            global::VRGIN.U46.Visuals.PlayAreaVisualization playAreaVisualization = new global::UnityEngine.GameObject("Play Area Viszalization").AddComponent <global::VRGIN.U46.Visuals.PlayAreaVisualization>();
            bool flag = playArea != null;

            if (flag)
            {
                playAreaVisualization.Area = playArea;
            }
            return(playAreaVisualization);
        }
Example #13
0
            // Token: 0x06000B55 RID: 2901 RVA: 0x000230A4 File Offset: 0x000212A4
            public static global::VRGIN.Helpers.UnityHelper.RayDrawer Create(global::UnityEngine.Color color, global::UnityEngine.Ray ray)
            {
                string text = "Ray Drawer (";

                global::UnityEngine.Color color2 = color;
                global::VRGIN.Helpers.UnityHelper.RayDrawer rayDrawer = new global::UnityEngine.GameObject(text + color2.ToString() + ")").AddComponent <global::VRGIN.Helpers.UnityHelper.RayDrawer>();
                rayDrawer.gameObject.AddComponent <global::UnityEngine.LineRenderer>();
                rayDrawer._Ray   = ray;
                rayDrawer._Color = color;
                return(rayDrawer);
            }
Example #14
0
 // Token: 0x060005D1 RID: 1489 RVA: 0x0001C49C File Offset: 0x0001A69C
 public static T CopyComponent <T>(T original, global::UnityEngine.GameObject destination) where T : global::UnityEngine.Component
 {
     global::System.Type                   type      = original.GetType();
     global::UnityEngine.Component         component = destination.AddComponent(type);
     global::System.Reflection.FieldInfo[] fields    = type.GetFields();
     foreach (global::System.Reflection.FieldInfo fieldInfo in fields)
     {
         fieldInfo.SetValue(component, fieldInfo.GetValue(original));
     }
     return(component as T);
 }
Example #15
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);
 }
        // Token: 0x060005FE RID: 1534 RVA: 0x0001D298 File Offset: 0x0001B498
        public static T CopyComponentFrom <T>(this global::UnityEngine.GameObject destination, T original) where T : global::UnityEngine.Component
        {
            global::System.Type type = original.GetType();
            T t = destination.AddComponent(type) as T;

            global::System.Reflection.FieldInfo[] fields = type.GetFields(20);
            foreach (global::System.Reflection.FieldInfo fieldInfo in fields)
            {
                fieldInfo.SetValue(t, fieldInfo.GetValue(original));
            }
            return(t);
        }
        // Token: 0x060005FD RID: 1533 RVA: 0x0001D230 File Offset: 0x0001B430
        public static U CopyComponentFrom <T, U>(this global::UnityEngine.GameObject destination, T original) where T : global::UnityEngine.Component where U : T
        {
            global::System.Type typeFromHandle = typeof(T);
            U u = destination.AddComponent <U>();

            global::System.Reflection.FieldInfo[] fields = typeFromHandle.GetFields(20);
            foreach (global::System.Reflection.FieldInfo fieldInfo in fields)
            {
                fieldInfo.SetValue(u, fieldInfo.GetValue(original));
            }
            return(u);
        }
Example #18
0
        // Token: 0x0600042F RID: 1071 RVA: 0x00015110 File Offset: 0x00013310
        protected override void OnStart()
        {
            base.OnStart();
            base.transform.SetParent(this._Target, false);
            global::UnityEngine.Canvas canvas = new global::UnityEngine.GameObject().AddComponent <global::UnityEngine.Canvas>();
            canvas.transform.SetParent(base.transform, false);
            canvas.renderMode = 2;
            canvas.GetComponent <global::UnityEngine.RectTransform>().SetSizeWithCurrentAnchors(0, 300f);
            canvas.GetComponent <global::UnityEngine.RectTransform>().SetSizeWithCurrentAnchors(1, 70f);
            base.transform.rotation        = this._Target.parent.rotation;
            canvas.transform.localScale    = new global::UnityEngine.Vector3(0.0001549628f, 0.0001549627f, 0f);
            canvas.transform.localPosition = this._TextOffset;
            canvas.transform.localRotation = global::UnityEngine.Quaternion.Euler(90f, 180f, 180f);
            global::UnityEngine.UI.Text text = new global::UnityEngine.GameObject().AddComponent <global::UnityEngine.UI.Text>();
            text.transform.SetParent(canvas.transform, false);
            text.GetComponent <global::UnityEngine.RectTransform>().anchorMin = global::UnityEngine.Vector2.zero;
            text.GetComponent <global::UnityEngine.RectTransform>().anchorMax = global::UnityEngine.Vector2.one;
            text.resizeTextForBestFit = true;
            text.resizeTextMaxSize    = 40;
            text.resizeTextMinSize    = 1;
            text.color = global::UnityEngine.Color.black;
            text.font  = global::UnityEngine.Resources.GetBuiltinResource <global::UnityEngine.Font>("Arial.ttf");
            text.horizontalOverflow = 0;
            text.verticalOverflow   = 0;
            text.alignment          = 4;
            text.text           = this._Text;
            this._Line          = base.gameObject.AddComponent <global::UnityEngine.LineRenderer>();
            this._Line.material = global::UnityEngine.Resources.GetBuiltinResource <global::UnityEngine.Material>("Sprites-Default.mat");
            this._Line.SetColors(global::UnityEngine.Color.cyan, global::UnityEngine.Color.cyan);
            this._Line.useWorldSpace = false;
            this._Line.SetVertexCount(4);
            this._Line.SetWidth(0.001f, 0.001f);
            global::UnityEngine.Quaternion quaternion = global::UnityEngine.Quaternion.Inverse(this._Target.localRotation);
            this._Line.SetPosition(0, this._LineOffset + this._HeightVector * 0.1f);
            this._Line.SetPosition(1, this._LineOffset + this._HeightVector * 0.5f + this._MovementVector * 0.2f);
            this._Line.SetPosition(2, this._TextOffset - this._HeightVector * 0.5f - this._MovementVector * 0.2f);
            this._Line.SetPosition(3, this._TextOffset - this._HeightVector * 0.1f);
            global::UnityEngine.GameObject gameObject = global::UnityEngine.GameObject.CreatePrimitive(5);
            gameObject.transform.SetParent(base.transform, false);
            gameObject.transform.localPosition = this._TextOffset - global::UnityEngine.Vector3.up * 0.001f;
            gameObject.transform.localRotation = global::UnityEngine.Quaternion.Euler(90f, 0f, 0f);
            gameObject.transform.localScale    = new global::UnityEngine.Vector3(0.05539737f, 0.009849964f, 0f);
            bool flag = !global::VRGIN.Controls.HelpText.S_Material;

            if (flag)
            {
                global::VRGIN.Controls.HelpText.S_Material       = global::VRGIN.Core.VRManager.Instance.Context.Materials.Unlit;
                global::VRGIN.Controls.HelpText.S_Material.color = global::UnityEngine.Color.white;
            }
            gameObject.transform.GetComponent <global::UnityEngine.Renderer>().sharedMaterial = global::VRGIN.Controls.HelpText.S_Material;
            gameObject.GetComponent <global::UnityEngine.Collider>().enabled = false;
        }
Example #19
0
 // Token: 0x0600042B RID: 1067 RVA: 0x00014F24 File Offset: 0x00013124
 private void CreateToolCanvas(global::VRGIN.Controls.Tools.Tool tool)
 {
     global::UnityEngine.UI.Image image = new global::UnityEngine.GameObject().AddComponent <global::UnityEngine.UI.Image>();
     image.transform.SetParent(this._Canvas.transform, false);
     global::UnityEngine.Texture2D image2 = tool.Image;
     image.sprite = global::UnityEngine.Sprite.Create(image2, new global::UnityEngine.Rect(0f, 0f, (float)image2.width, (float)image2.height), new global::UnityEngine.Vector2(0.5f, 0.5f));
     image.GetComponent <global::UnityEngine.RectTransform>().anchorMin = new global::UnityEngine.Vector2(0f, 0f);
     image.GetComponent <global::UnityEngine.RectTransform>().anchorMax = new global::UnityEngine.Vector2(1f, 1f);
     image.color = global::UnityEngine.Color.cyan;
     tool.Icon   = image.gameObject;
     tool.Icon.SetActive(false);
     tool.Icon.layer = 0;
 }
Example #20
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);
        }
    }
    // Token: 0x06000054 RID: 84 RVA: 0x00003C84 File Offset: 0x00001E84
    private void Awake()
    {
        int num = (this.objects != null) ? this.objects.Length : 0;

        global::UnityEngine.GameObject[] array = new global::UnityEngine.GameObject[2 + num];
        this.indices    = new uint[2 + num];
        array[0]        = this.right;
        this.indices[0] = uint.MaxValue;
        array[1]        = this.left;
        this.indices[1] = uint.MaxValue;
        for (int i = 0; i < num; i++)
        {
            array[2 + i]        = this.objects[i];
            this.indices[2 + i] = uint.MaxValue;
        }
        this.objects = array;
    }
Example #22
0
    // Token: 0x060000CC RID: 204 RVA: 0x000092A8 File Offset: 0x000074A8
    private void StripMesh(global::UnityEngine.GameObject go)
    {
        global::UnityEngine.MeshRenderer component = go.GetComponent <global::UnityEngine.MeshRenderer>();
        bool flag = component != null;

        if (flag)
        {
            global::UnityEngine.Object.DestroyImmediate(component);
        }
        global::UnityEngine.MeshFilter component2 = go.GetComponent <global::UnityEngine.MeshFilter>();
        bool flag2 = component2 != null;

        if (flag2)
        {
            global::UnityEngine.Object.DestroyImmediate(component2);
        }
    }
    // Token: 0x0600005A RID: 90 RVA: 0x00003FD4 File Offset: 0x000021D4
    private void SetTrackedDeviceIndex(int objectIndex, uint trackedDeviceIndex)
    {
        bool flag = trackedDeviceIndex != uint.MaxValue;

        if (flag)
        {
            for (int i = 0; i < this.objects.Length; i++)
            {
                bool flag2 = i != objectIndex && this.indices[i] == trackedDeviceIndex;
                if (flag2)
                {
                    global::UnityEngine.GameObject gameObject = this.objects[i];
                    bool flag3 = gameObject != null;
                    if (flag3)
                    {
                        gameObject.SetActive(false);
                    }
                    this.indices[i] = uint.MaxValue;
                }
            }
        }
        bool flag4 = trackedDeviceIndex != this.indices[objectIndex];

        if (flag4)
        {
            this.indices[objectIndex] = trackedDeviceIndex;
            global::UnityEngine.GameObject gameObject2 = this.objects[objectIndex];
            bool flag5 = gameObject2 != null;
            if (flag5)
            {
                bool flag6 = trackedDeviceIndex == uint.MaxValue;
                if (flag6)
                {
                    gameObject2.SetActive(false);
                }
                else
                {
                    gameObject2.SetActive(true);
                    gameObject2.BroadcastMessage("SetDeviceIndex", (int)trackedDeviceIndex, 1);
                }
            }
        }
    }
        // Token: 0x06000604 RID: 1540 RVA: 0x0001D3A5 File Offset: 0x0001B5A5
        public static global::System.Collections.Generic.IEnumerable <global::UnityEngine.GameObject> Descendants(this global::UnityEngine.GameObject gameObject)
        {
            global::System.Collections.Generic.Queue <global::UnityEngine.GameObject> queue = new global::System.Collections.Generic.Queue <global::UnityEngine.GameObject>();
            queue.Enqueue(gameObject);
            while (queue.Count > 0)
            {
                global::UnityEngine.GameObject obj = queue.Dequeue();
                foreach (global::UnityEngine.GameObject child in obj.Children())
                {
                    yield return(child);

                    queue.Enqueue(child);
                    child = null;
                }
                global::System.Collections.Generic.IEnumerator <global::UnityEngine.GameObject> enumerator = null;
                obj = null;
            }
            yield break;
            yield break;
        }
Example #25
0
    // Token: 0x060000BD RID: 189 RVA: 0x000086A0 File Offset: 0x000068A0
    private void Awake()
    {
        this.cameraMask = new global::UnityEngine.GameObject("cameraMask")
        {
            transform =
            {
                parent = base.transform
            }
        }.AddComponent <global::SteamVR_CameraMask>();
        bool flag = this.externalCamera == null && global::System.IO.File.Exists(this.externalCameraConfigPath);

        if (flag)
        {
            global::UnityEngine.GameObject gameObject  = global::UnityEngine.Resources.Load <global::UnityEngine.GameObject>("SteamVR_ExternalCamera");
            global::UnityEngine.GameObject gameObject2 = global::UnityEngine.Object.Instantiate <global::UnityEngine.GameObject>(gameObject);
            gameObject2.gameObject.name    = "External Camera";
            this.externalCamera            = gameObject2.transform.GetChild(0).GetComponent <global::SteamVR_ExternalCamera>();
            this.externalCamera.configPath = this.externalCameraConfigPath;
            this.externalCamera.ReadConfig();
        }
    }
Example #26
0
 // Token: 0x06000631 RID: 1585 RVA: 0x0001DCE4 File Offset: 0x0001BEE4
 public static global::VRGIN.Helpers.JSONClass AnalyzeNode(global::UnityEngine.GameObject go, bool onlyActive = false)
 {
     global::VRGIN.Helpers.JSONClass jsonclass = new global::VRGIN.Helpers.JSONClass();
     jsonclass["name"]   = go.name;
     jsonclass["active"] = go.activeSelf.ToString();
     jsonclass["tag"]    = go.tag;
     jsonclass["layer"]  = global::UnityEngine.LayerMask.LayerToName(go.gameObject.layer);
     jsonclass["pos"]    = go.transform.localPosition.ToString();
     jsonclass["rot"]    = go.transform.localEulerAngles.ToString();
     jsonclass["scale"]  = go.transform.localScale.ToString();
     global::VRGIN.Helpers.JSONClass jsonclass2 = new global::VRGIN.Helpers.JSONClass();
     foreach (global::UnityEngine.Component component in go.GetComponents <global::UnityEngine.Component>())
     {
         bool flag = component == null;
         if (flag)
         {
             string text = "NULL component: ";
             global::UnityEngine.Component component2 = component;
             global::UnityEngine.Debug.LogWarningFormat(text + ((component2 != null) ? component2.ToString() : null), global::System.Array.Empty <object>());
         }
         else
         {
             jsonclass2[component.GetType().Name] = global::EscalationVR.UnityHelper.AnalyzeComponent(component);
         }
     }
     global::VRGIN.Helpers.JSONArray jsonarray = new global::VRGIN.Helpers.JSONArray();
     foreach (global::UnityEngine.GameObject gameObject in go.Children())
     {
         bool flag2 = !onlyActive || gameObject.activeInHierarchy;
         if (flag2)
         {
             jsonarray.Add(global::EscalationVR.UnityHelper.AnalyzeNode(gameObject, onlyActive));
         }
     }
     jsonclass["Components"] = jsonclass2;
     jsonclass["Children"]   = jsonarray;
     return(jsonclass);
 }
 // Token: 0x060005FB RID: 1531 RVA: 0x0001D1A0 File Offset: 0x0001B3A0
 public static int Level(this global::UnityEngine.GameObject go)
 {
     return(go.transform.parent ? (go.transform.parent.gameObject.Level() + 1) : 0);
 }
Example #28
0
 // Token: 0x06000577 RID: 1399 RVA: 0x0001B404 File Offset: 0x00019604
 public static global::VRGIN.Helpers.LookTargetController AttachTo(global::VRGIN.Core.IActor actor, global::UnityEngine.GameObject gameObject)
 {
     return(gameObject.AddComponent <global::VRGIN.Helpers.LookTargetController>());
 }
        // Token: 0x06000600 RID: 1536 RVA: 0x0001D358 File Offset: 0x0001B558
        public static global::System.Collections.Generic.IEnumerable <global::UnityEngine.GameObject> Children(this global::UnityEngine.GameObject gameObject)
        {
            int num;

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

                num = i;
            }
            yield break;
        }
 // Token: 0x06000609 RID: 1545 RVA: 0x0001D4A4 File Offset: 0x0001B6A4
 public static global::UnityEngine.GameObject FindGameObjectByTag(this global::UnityEngine.GameObject gameObject, string tag)
 {
     return(global::System.Linq.Enumerable.FirstOrDefault <global::UnityEngine.GameObject>(gameObject.FindGameObjectsByTag(tag)));
 }