private void Update()
    {
        bool selfie = this.Yandere.Selfie;

        if (this.Snapping)
        {
            if (this.Yandere.Noticed)
            {
                this.Yandere.Shutter.ResumeGameplay();
                this.Yandere.StopAiming();
            }
            else if (this.Close)
            {
                this.currentPercent += 60f * Time.unscaledDeltaTime;
                while (this.currentPercent >= 1f)
                {
                    this.Frame           = Mathf.Min(this.Frame + 1, 8);
                    this.currentPercent -= 1f;
                }
                this.Sprite.spriteName = "Shutter" + this.Frame.ToString();
                if (this.Frame == 8)
                {
                    this.StudentManager.GhostChan.gameObject.SetActive(true);
                    this.PhotoDescription.SetActive(false);
                    this.PhotoDescLabel.text = "";
                    this.StudentManager.GhostChan.Look();
                    this.CheckPhoto();
                    if (this.PhotoDescLabel.text == "")
                    {
                        this.PhotoDescLabel.text = "Cannot determine subject of photo. Try again.";
                    }
                    this.PhotoDescription.SetActive(true);
                    this.SmartphoneCamera.targetTexture = null;
                    this.Yandere.PhonePromptBar.Show    = false;
                    this.NotificationManager.SetActive(false);
                    this.HeartbeatCamera.SetActive(false);
                    this.Yandere.SelfieGuide.SetActive(false);
                    this.MainCamera.enabled = false;
                    this.PhotoIcons.SetActive(true);
                    this.SubPanel.SetActive(false);
                    this.Panel.SetActive(false);
                    this.Close = false;
                    this.PromptBar.ClearButtons();
                    this.PromptBar.Label[0].text = "Save";
                    this.PromptBar.Label[1].text = "Delete";
                    if (!this.Yandere.RivalPhone)
                    {
                        this.PromptBar.Label[2].text = "Send";
                    }
                    else if (this.PantiesX.activeInHierarchy)
                    {
                        this.PromptBar.Label[0].text = "";
                    }
                    this.PromptBar.UpdateButtons();
                    this.PromptBar.Show = true;
                    Time.timeScale      = 0.0001f;
                }
            }
            else
            {
                this.currentPercent += 60f * Time.unscaledDeltaTime;
                while (this.currentPercent >= 1f)
                {
                    this.Frame           = Mathf.Max(this.Frame - 1, 1);
                    this.currentPercent -= 1f;
                }
                this.Sprite.spriteName = "Shutter" + this.Frame.ToString();
                if (this.Frame == 1)
                {
                    this.Sprite.color = new Color(this.Sprite.color.r, this.Sprite.color.g, this.Sprite.color.b, 0f);
                    this.Snapping     = false;
                }
            }
        }
        else if (this.Yandere.Aiming)
        {
            this.TargetStudent = 0;
            this.Timer        += Time.deltaTime;
            if (this.Timer > 0.5f)
            {
                Vector3 direction;
                if (!this.Yandere.Selfie)
                {
                    direction = this.SmartphoneCamera.transform.TransformDirection(Vector3.forward);
                }
                else
                {
                    direction = this.SelfieRayParent.TransformDirection(Vector3.forward);
                }
                if (Physics.Raycast(this.SmartphoneCamera.transform.position, direction, out this.hit, float.PositiveInfinity, this.OnlyPhotography))
                {
                    if (this.hit.collider.gameObject.name == "Face")
                    {
                        GameObject gameObject = this.hit.collider.gameObject.transform.root.gameObject;
                        this.FaceStudent = gameObject.GetComponent <StudentScript>();
                        if (this.FaceStudent != null)
                        {
                            this.TargetStudent = this.FaceStudent.StudentID;
                            if (this.TargetStudent > 1)
                            {
                                this.ReactionDistance = 1.66666f;
                            }
                            else
                            {
                                this.ReactionDistance = this.FaceStudent.VisionDistance;
                            }
                            bool enabled = this.FaceStudent.ShoeRemoval.enabled;
                            if (!this.FaceStudent.Alarmed && !this.FaceStudent.Dying && !this.FaceStudent.Distracted && !this.FaceStudent.InEvent && !this.FaceStudent.Wet && this.FaceStudent.Schoolwear > 0 && !this.FaceStudent.Fleeing && !this.FaceStudent.Following && !enabled && !this.FaceStudent.HoldingHands && this.FaceStudent.Actions[this.FaceStudent.Phase] != StudentActionType.Mourn && !this.FaceStudent.Guarding && !this.FaceStudent.Confessing && !this.FaceStudent.DiscCheck && !this.FaceStudent.TurnOffRadio && !this.FaceStudent.Investigating && !this.FaceStudent.Distracting && !this.FaceStudent.WitnessedLimb && !this.FaceStudent.WitnessedWeapon && !this.FaceStudent.WitnessedBloodPool && !this.FaceStudent.WitnessedBloodyWeapon && Vector3.Distance(this.Yandere.transform.position, gameObject.transform.position) < this.ReactionDistance && this.FaceStudent.CanSeeObject(this.Yandere.gameObject, this.Yandere.transform.position + Vector3.up))
                            {
                                if (this.MissionMode)
                                {
                                    this.PenaltyTimer += Time.deltaTime;
                                    if (this.PenaltyTimer > 1f)
                                    {
                                        this.FaceStudent.Reputation.PendingRep -= -10f;
                                        this.PenaltyTimer = 0f;
                                    }
                                }
                                if (!this.FaceStudent.CameraReacting)
                                {
                                    if (this.FaceStudent.enabled && !this.FaceStudent.Stop)
                                    {
                                        if ((this.FaceStudent.DistanceToDestination < 5f && this.FaceStudent.Actions[this.FaceStudent.Phase] == StudentActionType.Graffiti) || (this.FaceStudent.DistanceToDestination < 5f && this.FaceStudent.Actions[this.FaceStudent.Phase] == StudentActionType.Bully))
                                        {
                                            this.FaceStudent.PhotoPatience = 0f;
                                            this.FaceStudent.KilledMood    = true;
                                            this.FaceStudent.Ignoring      = true;
                                            this.PenaltyTimer = 1f;
                                            this.Penalize();
                                        }
                                        else if (this.FaceStudent.PhotoPatience > 0f)
                                        {
                                            if (this.FaceStudent.StudentID > 1)
                                            {
                                                if ((this.Yandere.Bloodiness > 0f && !this.Yandere.Paint) || (double)this.Yandere.Sanity < 33.33333)
                                                {
                                                    this.FaceStudent.Alarm += 200f;
                                                }
                                                else
                                                {
                                                    this.FaceStudent.CameraReact();
                                                }
                                            }
                                            else
                                            {
                                                this.FaceStudent.Alarm         += Time.deltaTime * (100f / this.FaceStudent.DistanceToPlayer) * this.FaceStudent.Paranoia * this.FaceStudent.Perception * this.FaceStudent.DistanceToPlayer * 2f;
                                                this.FaceStudent.YandereVisible = true;
                                            }
                                        }
                                        else
                                        {
                                            this.Penalize();
                                        }
                                    }
                                }
                                else
                                {
                                    this.FaceStudent.PhotoPatience = Mathf.MoveTowards(this.FaceStudent.PhotoPatience, 0f, Time.deltaTime);
                                    if (this.FaceStudent.PhotoPatience > 0f)
                                    {
                                        this.FaceStudent.CameraPoseTimer = 1f;
                                        if (this.MissionMode)
                                        {
                                            this.FaceStudent.PhotoPatience = 0f;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else if (this.hit.collider.gameObject.name == "Panties" || this.hit.collider.gameObject.name == "Skirt")
                    {
                        GameObject gameObject2 = this.hit.collider.gameObject.transform.root.gameObject;
                        if (Physics.Raycast(this.SmartphoneCamera.transform.position, direction, out this.hit, float.PositiveInfinity, this.OnlyCharacters))
                        {
                            if (Vector3.Distance(this.Yandere.transform.position, gameObject2.transform.position) < 5f)
                            {
                                if (this.hit.collider.gameObject == gameObject2)
                                {
                                    if (!this.Yandere.Lewd)
                                    {
                                        this.Yandere.NotificationManager.DisplayNotification(NotificationType.Lewd);
                                    }
                                    this.Yandere.Lewd = true;
                                }
                                else
                                {
                                    this.Yandere.Lewd = false;
                                }
                            }
                            else
                            {
                                this.Yandere.Lewd = false;
                            }
                        }
                    }
                    else
                    {
                        this.Yandere.Lewd = false;
                    }
                }
                else
                {
                    this.Yandere.Lewd = false;
                }
            }
        }
        else
        {
            this.Timer = 0f;
        }
        if (this.TookPhoto)
        {
            this.ResumeGameplay();
        }
        if (!this.DisplayError)
        {
            if (this.PhotoIcons.activeInHierarchy && !this.Snapping && !this.TextMessages.gameObject.activeInHierarchy)
            {
                if (Input.GetButtonDown("A"))
                {
                    if (!this.Yandere.RivalPhone)
                    {
                        bool flag  = !this.BullyX.activeInHierarchy;
                        bool flag2 = !this.SenpaiX.activeInHierarchy;
                        this.PromptBar.transform.localPosition = new Vector3(this.PromptBar.transform.localPosition.x, -627f, this.PromptBar.transform.localPosition.z);
                        this.PromptBar.ClearButtons();
                        this.PromptBar.Show = false;
                        this.PhotoIcons.SetActive(false);
                        this.ID        = 0;
                        this.FreeSpace = false;
                        while (this.ID < 26)
                        {
                            this.ID++;
                            if (!PlayerGlobals.GetPhoto(this.ID))
                            {
                                this.FreeSpace = true;
                                this.Slot      = this.ID;
                                this.ID        = 26;
                            }
                        }
                        if (this.FreeSpace)
                        {
                            ScreenCapture.CaptureScreenshot(Application.streamingAssetsPath + "/Photographs/Photo_" + this.Slot.ToString() + ".png");
                            this.TookPhoto = true;
                            Debug.Log("Setting Photo " + this.Slot + " to ''true''.");
                            PlayerGlobals.SetPhoto(this.Slot, true);
                            if (flag)
                            {
                                Debug.Log("Saving a bully photo!");
                                int studentID = this.BullyPhotoCollider.transform.parent.gameObject.GetComponent <StudentScript>().StudentID;
                                if (this.StudentManager.Students[studentID].Club != ClubType.Bully)
                                {
                                    PlayerGlobals.SetBullyPhoto(this.Slot, studentID);
                                }
                                else
                                {
                                    PlayerGlobals.SetBullyPhoto(this.Slot, this.StudentManager.Students[studentID].DistractionTarget.StudentID);
                                }
                            }
                            if (flag2)
                            {
                                PlayerGlobals.SetSenpaiPhoto(this.Slot, true);
                            }
                            if (this.AirGuitarShot)
                            {
                                TaskGlobals.SetGuitarPhoto(this.Slot, true);
                                this.TaskManager.UpdateTaskStatus();
                            }
                            if (this.KittenShot)
                            {
                                TaskGlobals.SetKittenPhoto(this.Slot, true);
                                this.TaskManager.UpdateTaskStatus();
                            }
                            if (this.HorudaShot)
                            {
                                TaskGlobals.SetHorudaPhoto(this.Slot, true);
                                this.TaskManager.UpdateTaskStatus();
                            }
                            if (this.OsanaShot && SchemeGlobals.GetSchemeStage(4) == 6)
                            {
                                SchemeGlobals.SetSchemeStage(4, 7);
                                this.Yandere.PauseScreen.Schemes.UpdateInstructions();
                            }
                        }
                        else
                        {
                            this.DisplayError = true;
                        }
                    }
                    else if (!this.PantiesX.activeInHierarchy)
                    {
                        if (SchemeGlobals.GetSchemeStage(1) == 5)
                        {
                            SchemeGlobals.SetSchemeStage(1, 6);
                            this.Schemes.UpdateInstructions();
                        }
                        this.StudentManager.CommunalLocker.RivalPhone.LewdPhotos = true;
                        this.ResumeGameplay();
                    }
                }
                if (!this.Yandere.RivalPhone && Input.GetButtonDown("X"))
                {
                    this.Panel.SetActive(true);
                    this.MainMenu.SetActive(false);
                    this.PauseScreen.Show          = true;
                    this.PauseScreen.Panel.enabled = true;
                    this.PromptBar.ClearButtons();
                    this.PromptBar.Label[1].text = "Exit";
                    if (this.PantiesX.activeInHierarchy)
                    {
                        this.PromptBar.Label[3].text = "Interests";
                    }
                    else
                    {
                        this.PromptBar.Label[3].text = "";
                    }
                    this.PromptBar.UpdateButtons();
                    if (!this.InfoX.activeInHierarchy)
                    {
                        this.PauseScreen.Sideways = true;
                        StudentGlobals.SetStudentPhotographed(this.Student.StudentID, true);
                        this.ID = 0;
                        while (this.ID < this.Student.Outlines.Length)
                        {
                            this.Student.Outlines[this.ID].enabled = true;
                            this.ID++;
                        }
                        this.StudentInfo.UpdateInfo(this.Student.StudentID);
                        this.StudentInfo.gameObject.SetActive(true);
                    }
                    else if (!this.TextMessages.gameObject.activeInHierarchy)
                    {
                        this.PauseScreen.Sideways = false;
                        this.TextMessages.gameObject.SetActive(true);
                        this.SpawnMessage();
                    }
                }
                if (Input.GetButtonDown("B"))
                {
                    this.ResumeGameplay();
                    return;
                }
            }
            else if (this.PhotoIcons.activeInHierarchy && Input.GetButtonDown("B"))
            {
                this.ResumeGameplay();
                return;
            }
        }
        else
        {
            float t = Time.unscaledDeltaTime * 10f;
            this.ErrorWindow.transform.localScale = Vector3.Lerp(this.ErrorWindow.transform.localScale, new Vector3(1f, 1f, 1f), t);
            if (Input.GetButtonDown("A"))
            {
                this.ResumeGameplay();
            }
        }
    }