示例#1
0
        /// <summary>
        /// Toggles the mirror.
        /// </summary>
        private void ToggleMirror()
        {
            if (this.status == GridStatus.NOTHING && StageManager.StatusPanel.CanRequestMirror)
            {
                if (this.mirror == null)
                {
                    this.mirror = this.SpawnMirror();
                }
                else
                {
                    this.mirror.transform.Rotate(new Vector3(0, 0, -90));
                    this.mirror.SetActive(true);
                }

                StageManager.StatusPanel.RequestMirror();
                this.status = GridStatus.MIRROR_LEFT_UP;
                SoundManager.PlaySEToggleMirror(1);
            }
            else if (this.status == GridStatus.MIRROR_LEFT_UP)
            {
                this.mirror.transform.Rotate(new Vector3(0, 0, -90));
                this.status = GridStatus.MIRROR_RIGHT_UP;
                SoundManager.PlaySEToggleMirror(2);
            }
            else if (this.status == GridStatus.MIRROR_RIGHT_UP)
            {
                this.mirror.transform.Rotate(new Vector3(0, 0, -90));
                this.status = GridStatus.MIRROR_RIGHT_DOWN;
                SoundManager.PlaySEToggleMirror(3);
            }
            else if (this.status == GridStatus.MIRROR_RIGHT_DOWN)
            {
                this.mirror.transform.Rotate(new Vector3(0, 0, -90));
                this.status = GridStatus.MIRROR_LEFT_DOWN;
                SoundManager.PlaySEToggleMirror(4);
            }
            else if (this.status == GridStatus.MIRROR_LEFT_DOWN)
            {
                this.mirror.SetActive(false);
                this.status = GridStatus.NOTHING;

                StageManager.StatusPanel.RevokeMirror();
                this.AddLight(true);
                SoundManager.PlaySEToggleMirror(0);
            }
        }