Esempio n. 1
0
        protected override void InitPointer()
        {
            pointerCursor = (customPointerCursor ? Instantiate(customPointerCursor) : CreateCursor());
            if (validTeleportLocationObject != null)
            {
                validTeleportLocationInstance                  = Instantiate(validTeleportLocationObject);
                validTeleportLocationInstance.name             = string.Format("[{0}]WorldPointer_BezierPointer_TeleportBeam", gameObject.name);
                validTeleportLocationInstance.transform.parent = pointerCursor.transform;
                validTeleportLocationInstance.layer            = LayerMask.NameToLayer("Ignore Raycast");
                validTeleportLocationInstance.SetActive(false);
            }

            pointerCursor.name = string.Format("[{0}]WorldPointer_BezierPointer_PointerCursor", gameObject.name);
            Utilities.SetPlayerObject(pointerCursor, VRTK_PlayerObject.ObjectTypes.Pointer);
            pointerCursor.layer = LayerMask.NameToLayer("Ignore Raycast");
            pointerCursor.SetActive(false);

            curvedBeamContainer = new GameObject(string.Format("[{0}]WorldPointer_BezierPointer_CurvedBeamContainer", gameObject.name));
            Utilities.SetPlayerObject(curvedBeamContainer, VRTK_PlayerObject.ObjectTypes.Pointer);
            curvedBeamContainer.SetActive(false);
            curvedBeam = curvedBeamContainer.gameObject.AddComponent <CurveGenerator>();
            curvedBeam.transform.parent = null;
            curvedBeam.Create(pointerDensity, pointerCursorRadius, customPointerTracer, rescalePointerTracer);

            base.InitPointer();
        }
Esempio n. 2
0
        protected override void InitPointer()
        {
            if (customPointerTracer != null)
            {
                var renderer = customPointerTracer.GetComponentInChildren <MeshRenderer>();
                if (renderer)
                {
                    beamTraceMaterial = Instantiate(renderer.sharedMaterial);
                }
            }

            if (customPointerCursor)
            {
                var customPointerCursorRenderer = customPointerCursor.GetComponentInChildren <MeshRenderer>();

                if (customPointerCursorRenderer != null)
                {
                    customPointerMaterial = Instantiate(customPointerCursorRenderer.sharedMaterial);
                }

                pointerCursor = Instantiate(customPointerCursor);

                foreach (var pointerCursorRenderer in pointerCursor.GetComponentsInChildren <Renderer>())
                {
                    pointerCursorRenderer.material = customPointerMaterial;
                }

                if (validTeleportLocationObject != null)
                {
                    validTeleportLocationInstance                  = Instantiate(validTeleportLocationObject);
                    validTeleportLocationInstance.name             = string.Format("[{0}]WorldPointer_BezierPointer_TeleportBeam", gameObject.name);
                    validTeleportLocationInstance.transform.parent = pointerCursor.transform;
                    validTeleportLocationInstance.layer            = LayerMask.NameToLayer("Ignore Raycast");
                    validTeleportLocationInstance.SetActive(false);
                }
            }
            else
            {
                pointerCursor = CreateCursor();
            }

            pointerCursor.name = string.Format("[{0}]WorldPointer_BezierPointer_PointerCursor", gameObject.name);
            Utilities.SetPlayerObject(pointerCursor, VRTK_PlayerObject.ObjectTypes.Pointer);
            pointerCursor.layer = LayerMask.NameToLayer("Ignore Raycast");
            pointerCursor.SetActive(false);

            curvedBeamContainer = new GameObject(string.Format("[{0}]WorldPointer_BezierPointer_CurvedBeamContainer", gameObject.name));
            Utilities.SetPlayerObject(curvedBeamContainer, VRTK_PlayerObject.ObjectTypes.Pointer);
            curvedBeamContainer.SetActive(false);
            curvedBeam = curvedBeamContainer.gameObject.AddComponent <CurveGenerator>();
            curvedBeam.transform.parent = null;
            curvedBeam.Create(pointerDensity, pointerCursorRadius, customPointerTracer, rescalePointerTracer);
            base.InitPointer();
        }
        protected override void InitPointer()
        {
            pointerCursor = (customPointerCursor ? Instantiate(customPointerCursor) : CreateCursor());

            pointerCursor.name = string.Format("[{0}]PlayerObject_WorldPointer_BezierPointer_PointerCursor", this.gameObject.name);
            pointerCursor.layer = 2;
            pointerCursor.SetActive(false);

            GameObject global = new GameObject(string.Format("[{0}]PlayerObject_WorldPointer_BezierPointer_CurvedBeamContainer", this.gameObject.name));
            global.SetActive(false);
            curvedBeam = global.gameObject.AddComponent<CurveGenerator>();
            curvedBeam.transform.parent = null;
            curvedBeam.Create(pointerDensity, pointerCursorRadius, customPointerTracer);
            base.InitPointer();
        }
Esempio n. 4
0
        protected override void InitPointer()
        {
            pointerCursor = (customPointerCursor ? Instantiate(customPointerCursor) : CreateCursor());

            pointerCursor.name  = string.Format("[{0}]PlayerObject_WorldPointer_BezierPointer_PointerCursor", this.gameObject.name);
            pointerCursor.layer = 2;
            pointerCursor.SetActive(false);

            GameObject global = new GameObject(string.Format("[{0}]PlayerObject_WorldPointer_BezierPointer_CurvedBeamContainer", this.gameObject.name));

            global.SetActive(false);
            curvedBeam = global.gameObject.AddComponent <CurveGenerator>();
            curvedBeam.transform.parent = null;
            curvedBeam.Create(pointerDensity, pointerCursorRadius, customPointerTracer);
            base.InitPointer();
        }
        protected override void InitPointer()
        {
            pointerCursor = (customPointerCursor ? Instantiate(customPointerCursor) : CreateCursor());

            pointerCursor.name = string.Format("[{0}]WorldPointer_BezierPointer_PointerCursor", this.gameObject.name);
            Utilities.SetPlayerObject(pointerCursor, VRTK_PlayerObject.ObjectTypes.Pointer);
            pointerCursor.layer = LayerMask.NameToLayer("Ignore Raycast");
            pointerCursor.SetActive(false);

            curvedBeamContainer = new GameObject(string.Format("[{0}]WorldPointer_BezierPointer_CurvedBeamContainer", this.gameObject.name));
            Utilities.SetPlayerObject(curvedBeamContainer, VRTK_PlayerObject.ObjectTypes.Pointer);
            curvedBeamContainer.SetActive(false);
            curvedBeam = curvedBeamContainer.gameObject.AddComponent<CurveGenerator>();
            curvedBeam.transform.parent = null;
            curvedBeam.Create(pointerDensity, pointerCursorRadius, customPointerTracer);
            base.InitPointer();
        }