//-------------------------------------------------
        void Awake()
        {
            _instance = this;

            chaperoneInfoInitializedAction = ChaperoneInfo.InitializedAction(OnChaperoneInfoInitialized);

            pointerLineRenderer   = GetComponentInChildren <LineRenderer>();
            teleportPointerObject = pointerLineRenderer.gameObject;

            int tintColorID = Shader.PropertyToID("_TintColor");

            fullTintAlpha = pointVisibleMaterial.GetColor(tintColorID).a;

            teleportArc = GetComponent <TeleportArc>();
            teleportArc.traceLayerMask = traceLayerMask;

            loopingAudioMaxVolume = loopingAudioSource.volume;

            playAreaPreviewCorner.SetActive(false);
            playAreaPreviewSide.SetActive(false);

            float invalidReticleStartingScale = invalidReticleTransform.localScale.x;

            invalidReticleMinScale *= invalidReticleStartingScale;
            invalidReticleMaxScale *= invalidReticleStartingScale;
        }
        //-------------------------------------------------
        void Awake()
        {
            camera       = GameObject.FindGameObjectWithTag("MainCamera");
            cameraScript = camera.GetComponent <PostProcess>();
            cameraPostProcessMaterial = cameraScript.material;
            //cameraPostProcessMaterial.SetFloat("_VRadius", 0.0f);
            //cameraPostProcessMaterial.SetFloat("_VSoft", 0.0f);
            _instance = this;

            chaperoneInfoInitializedAction = ChaperoneInfo.InitializedAction(OnChaperoneInfoInitialized);

            pointerLineRenderer   = GetComponentInChildren <LineRenderer>();
            teleportPointerObject = pointerLineRenderer.gameObject;

            int tintColorID = Shader.PropertyToID("_TintColor");

            fullTintAlpha = pointVisibleMaterial.GetColor(tintColorID).a;

            teleportArc = GetComponent <TeleportArc>();
            teleportArc.traceLayerMask = traceLayerMask;

            loopingAudioMaxVolume = loopingAudioSource.volume;

            playAreaPreviewCorner.SetActive(false);
            playAreaPreviewSide.SetActive(false);

            float invalidReticleStartingScale = invalidReticleTransform.localScale.x;

            invalidReticleMinScale *= invalidReticleStartingScale;
            invalidReticleMaxScale *= invalidReticleStartingScale;
        }
Exemple #3
0
        // Token: 0x060021FE RID: 8702 RVA: 0x000A8578 File Offset: 0x000A6778
        private void OnChaperoneInfoInitialized()
        {
            ChaperoneInfo instance = ChaperoneInfo.instance;

            if (instance.initialized && instance.roomscale)
            {
                if (this.playAreaPreviewTransform == null)
                {
                    this.playAreaPreviewTransform        = new GameObject("PlayAreaPreviewTransform").transform;
                    this.playAreaPreviewTransform.parent = base.transform;
                    Util.ResetTransform(this.playAreaPreviewTransform, true);
                    this.playAreaPreviewCorner.SetActive(true);
                    this.playAreaPreviewCorners    = new Transform[4];
                    this.playAreaPreviewCorners[0] = this.playAreaPreviewCorner.transform;
                    this.playAreaPreviewCorners[1] = Object.Instantiate <Transform>(this.playAreaPreviewCorners[0]);
                    this.playAreaPreviewCorners[2] = Object.Instantiate <Transform>(this.playAreaPreviewCorners[0]);
                    this.playAreaPreviewCorners[3] = Object.Instantiate <Transform>(this.playAreaPreviewCorners[0]);
                    this.playAreaPreviewCorners[0].transform.parent = this.playAreaPreviewTransform;
                    this.playAreaPreviewCorners[1].transform.parent = this.playAreaPreviewTransform;
                    this.playAreaPreviewCorners[2].transform.parent = this.playAreaPreviewTransform;
                    this.playAreaPreviewCorners[3].transform.parent = this.playAreaPreviewTransform;
                    this.playAreaPreviewSide.SetActive(true);
                    this.playAreaPreviewSides    = new Transform[4];
                    this.playAreaPreviewSides[0] = this.playAreaPreviewSide.transform;
                    this.playAreaPreviewSides[1] = Object.Instantiate <Transform>(this.playAreaPreviewSides[0]);
                    this.playAreaPreviewSides[2] = Object.Instantiate <Transform>(this.playAreaPreviewSides[0]);
                    this.playAreaPreviewSides[3] = Object.Instantiate <Transform>(this.playAreaPreviewSides[0]);
                    this.playAreaPreviewSides[0].transform.parent = this.playAreaPreviewTransform;
                    this.playAreaPreviewSides[1].transform.parent = this.playAreaPreviewTransform;
                    this.playAreaPreviewSides[2].transform.parent = this.playAreaPreviewTransform;
                    this.playAreaPreviewSides[3].transform.parent = this.playAreaPreviewTransform;
                }
                float playAreaSizeX = instance.playAreaSizeX;
                float playAreaSizeZ = instance.playAreaSizeZ;
                this.playAreaPreviewSides[0].localPosition   = new Vector3(0f, 0f, 0.5f * playAreaSizeZ - 0.25f);
                this.playAreaPreviewSides[1].localPosition   = new Vector3(0f, 0f, -0.5f * playAreaSizeZ + 0.25f);
                this.playAreaPreviewSides[2].localPosition   = new Vector3(0.5f * playAreaSizeX - 0.25f, 0f, 0f);
                this.playAreaPreviewSides[3].localPosition   = new Vector3(-0.5f * playAreaSizeX + 0.25f, 0f, 0f);
                this.playAreaPreviewSides[0].localScale      = new Vector3(playAreaSizeX - 0.5f, 1f, 1f);
                this.playAreaPreviewSides[1].localScale      = new Vector3(playAreaSizeX - 0.5f, 1f, 1f);
                this.playAreaPreviewSides[2].localScale      = new Vector3(playAreaSizeZ - 0.5f, 1f, 1f);
                this.playAreaPreviewSides[3].localScale      = new Vector3(playAreaSizeZ - 0.5f, 1f, 1f);
                this.playAreaPreviewSides[0].localRotation   = Quaternion.Euler(0f, 0f, 0f);
                this.playAreaPreviewSides[1].localRotation   = Quaternion.Euler(0f, 180f, 0f);
                this.playAreaPreviewSides[2].localRotation   = Quaternion.Euler(0f, 90f, 0f);
                this.playAreaPreviewSides[3].localRotation   = Quaternion.Euler(0f, 270f, 0f);
                this.playAreaPreviewCorners[0].localPosition = new Vector3(0.5f * playAreaSizeX - 0.25f, 0f, 0.5f * playAreaSizeZ - 0.25f);
                this.playAreaPreviewCorners[1].localPosition = new Vector3(0.5f * playAreaSizeX - 0.25f, 0f, -0.5f * playAreaSizeZ + 0.25f);
                this.playAreaPreviewCorners[2].localPosition = new Vector3(-0.5f * playAreaSizeX + 0.25f, 0f, -0.5f * playAreaSizeZ + 0.25f);
                this.playAreaPreviewCorners[3].localPosition = new Vector3(-0.5f * playAreaSizeX + 0.25f, 0f, 0.5f * playAreaSizeZ - 0.25f);
                this.playAreaPreviewCorners[0].localRotation = Quaternion.Euler(0f, 0f, 0f);
                this.playAreaPreviewCorners[1].localRotation = Quaternion.Euler(0f, 90f, 0f);
                this.playAreaPreviewCorners[2].localRotation = Quaternion.Euler(0f, 180f, 0f);
                this.playAreaPreviewCorners[3].localRotation = Quaternion.Euler(0f, 270f, 0f);
                this.playAreaPreviewTransform.gameObject.SetActive(false);
            }
        }
Exemple #4
0
        // Token: 0x060021F5 RID: 8693 RVA: 0x000A7BCC File Offset: 0x000A5DCC
        private void Awake()
        {
            Teleport._instance = this;
            this.chaperoneInfoInitializedAction = ChaperoneInfo.InitializedAction(new UnityAction(this.OnChaperoneInfoInitialized));
            this.pointerLineRenderer            = base.GetComponentInChildren <LineRenderer>();
            this.teleportPointerObject          = this.pointerLineRenderer.gameObject;
            int nameID = Shader.PropertyToID("_TintColor");

            this.fullTintAlpha = this.pointVisibleMaterial.GetColor(nameID).a;
            this.teleportArc   = base.GetComponent <TeleportArc>();
            this.teleportArc.traceLayerMask = this.traceLayerMask;
            this.loopingAudioMaxVolume      = this.loopingAudioSource.volume;
            this.playAreaPreviewCorner.SetActive(false);
            this.playAreaPreviewSide.SetActive(false);
            float x = this.invalidReticleTransform.localScale.x;

            this.invalidReticleMinScale *= x;
            this.invalidReticleMaxScale *= x;
        }
        //-------------------------------------------------
        private void OnChaperoneInfoInitialized()
        {
            ChaperoneInfo chaperone = ChaperoneInfo.instance;

            if (chaperone.initialized && chaperone.roomscale)
            {
                //Set up the render model for the play area bounds

                if (playAreaPreviewTransform == null)
                {
                    playAreaPreviewTransform        = new GameObject("PlayAreaPreviewTransform").transform;
                    playAreaPreviewTransform.parent = transform;
                    Util.ResetTransform(playAreaPreviewTransform);

                    playAreaPreviewCorner.SetActive(true);
                    playAreaPreviewCorners    = new Transform[4];
                    playAreaPreviewCorners[0] = playAreaPreviewCorner.transform;
                    playAreaPreviewCorners[1] = Instantiate(playAreaPreviewCorners[0]);
                    playAreaPreviewCorners[2] = Instantiate(playAreaPreviewCorners[0]);
                    playAreaPreviewCorners[3] = Instantiate(playAreaPreviewCorners[0]);

                    playAreaPreviewCorners[0].transform.parent = playAreaPreviewTransform;
                    playAreaPreviewCorners[1].transform.parent = playAreaPreviewTransform;
                    playAreaPreviewCorners[2].transform.parent = playAreaPreviewTransform;
                    playAreaPreviewCorners[3].transform.parent = playAreaPreviewTransform;

                    playAreaPreviewSide.SetActive(true);
                    playAreaPreviewSides    = new Transform[4];
                    playAreaPreviewSides[0] = playAreaPreviewSide.transform;
                    playAreaPreviewSides[1] = Instantiate(playAreaPreviewSides[0]);
                    playAreaPreviewSides[2] = Instantiate(playAreaPreviewSides[0]);
                    playAreaPreviewSides[3] = Instantiate(playAreaPreviewSides[0]);

                    playAreaPreviewSides[0].transform.parent = playAreaPreviewTransform;
                    playAreaPreviewSides[1].transform.parent = playAreaPreviewTransform;
                    playAreaPreviewSides[2].transform.parent = playAreaPreviewTransform;
                    playAreaPreviewSides[3].transform.parent = playAreaPreviewTransform;
                }

                float x = chaperone.playAreaSizeX;
                float z = chaperone.playAreaSizeZ;

                playAreaPreviewSides[0].localPosition = new Vector3(0.0f, 0.0f, 0.5f * z - 0.25f);
                playAreaPreviewSides[1].localPosition = new Vector3(0.0f, 0.0f, -0.5f * z + 0.25f);
                playAreaPreviewSides[2].localPosition = new Vector3(0.5f * x - 0.25f, 0.0f, 0.0f);
                playAreaPreviewSides[3].localPosition = new Vector3(-0.5f * x + 0.25f, 0.0f, 0.0f);

                playAreaPreviewSides[0].localScale = new Vector3(x - 0.5f, 1.0f, 1.0f);
                playAreaPreviewSides[1].localScale = new Vector3(x - 0.5f, 1.0f, 1.0f);
                playAreaPreviewSides[2].localScale = new Vector3(z - 0.5f, 1.0f, 1.0f);
                playAreaPreviewSides[3].localScale = new Vector3(z - 0.5f, 1.0f, 1.0f);

                playAreaPreviewSides[0].localRotation = Quaternion.Euler(0.0f, 0.0f, 0.0f);
                playAreaPreviewSides[1].localRotation = Quaternion.Euler(0.0f, 180.0f, 0.0f);
                playAreaPreviewSides[2].localRotation = Quaternion.Euler(0.0f, 90.0f, 0.0f);
                playAreaPreviewSides[3].localRotation = Quaternion.Euler(0.0f, 270.0f, 0.0f);

                playAreaPreviewCorners[0].localPosition = new Vector3(0.5f * x - 0.25f, 0.0f, 0.5f * z - 0.25f);
                playAreaPreviewCorners[1].localPosition = new Vector3(0.5f * x - 0.25f, 0.0f, -0.5f * z + 0.25f);
                playAreaPreviewCorners[2].localPosition = new Vector3(-0.5f * x + 0.25f, 0.0f, -0.5f * z + 0.25f);
                playAreaPreviewCorners[3].localPosition = new Vector3(-0.5f * x + 0.25f, 0.0f, 0.5f * z - 0.25f);

                playAreaPreviewCorners[0].localRotation = Quaternion.Euler(0.0f, 0.0f, 0.0f);
                playAreaPreviewCorners[1].localRotation = Quaternion.Euler(0.0f, 90.0f, 0.0f);
                playAreaPreviewCorners[2].localRotation = Quaternion.Euler(0.0f, 180.0f, 0.0f);
                playAreaPreviewCorners[3].localRotation = Quaternion.Euler(0.0f, 270.0f, 0.0f);

                playAreaPreviewTransform.gameObject.SetActive(false);
            }
        }