public void SetFrame(int f, Vector2 position)
    {
        currentFrame          = f;
        spriteRenderer.sprite = frames[f];

        if (playFootstepFrames[f])
        {
            AudioClipPlayer.Play(footstepClip, Random.Range(0.9f, 1.1f), footstepVolume, position, audioClipPlayerPrefab);
        }
    }
Beispiel #2
0
    public static void PlayEffect(AudioClip clip)
    {
        if (clip == null)
        {
            return;
        }

        AudioClipPlayer player = Instantiate(m_Instance.AudioClipPlayerPrefab, m_Instance.transform).GetComponent <AudioClipPlayer>();

        player.Play(clip);
    }
Beispiel #3
0
    public static void PlayEffect(EffectType type)
    {
        AudioClip clip = m_Instance.GetAudioClipForType(type);

        if (clip == null)
        {
            return;
        }

        AudioClipPlayer player = Instantiate(m_Instance.AudioClipPlayerPrefab, m_Instance.transform).GetComponent <AudioClipPlayer>();

        player.Play(clip);
    }
    IEnumerator Start()
    {
        particle = GetComponent <ParticleSystem>();

        if (_onPlaySE)
        {
            audio = GetComponent <AudioClipPlayer>();
            audio.Play(_clip);
        }

        // エフェクト再生が完了するまで待機
        while (particle.isPlaying)
        {
            yield return(null);
        }

        Destroy(gameObject);
    }
 private void Update()
 {
     if (this.Flicker)
     {
         this.FlickerTimer += Time.deltaTime;
         if (this.FlickerTimer > 0.1f)
         {
             this.FlickerTimer = 0f;
             this.BathroomLight.SetActive(!this.BathroomLight.activeInHierarchy);
         }
     }
     if (!this.Panel.useGravity)
     {
         if (this.Yandere.Armed)
         {
             this.Prompt.HideButton[3] = (this.Yandere.EquippedWeapon.WeaponID != 6);
         }
         else
         {
             this.Prompt.HideButton[3] = true;
         }
     }
     if (this.Prompt.Circle[0].fillAmount == 0f)
     {
         this.Prompt.Circle[0].fillAmount = 1f;
         AudioSource component = base.GetComponent <AudioSource>();
         if (this.BathroomLight.activeInHierarchy)
         {
             this.Prompt.Label[0].text = "     Turn On";
             this.BathroomLight.SetActive(false);
             component.clip = this.Flick[1];
             component.Play();
             if (this.ToiletEvent.EventActive && (this.ToiletEvent.EventPhase == 2 || this.ToiletEvent.EventPhase == 3))
             {
                 this.ReactionID = UnityEngine.Random.Range(1, 4);
                 AudioClipPlayer.Play(this.ReactionClips[this.ReactionID], this.ToiletEvent.EventStudent.transform.position, 5f, 10f, out this.ToiletEvent.VoiceClip);
                 this.ToiletEvent.EventSubtitle.text = this.ReactionTexts[this.ReactionID];
                 this.SubtitleTimer += Time.deltaTime;
             }
         }
         else
         {
             this.Prompt.Label[0].text = "     Turn Off";
             this.BathroomLight.SetActive(true);
             component.clip = this.Flick[0];
             component.Play();
         }
     }
     if (this.SubtitleTimer > 0f)
     {
         this.SubtitleTimer += Time.deltaTime;
         if (this.SubtitleTimer > 3f)
         {
             this.ToiletEvent.EventSubtitle.text = string.Empty;
             this.SubtitleTimer = 0f;
         }
     }
     if (this.Prompt.Circle[3].fillAmount == 0f)
     {
         this.Prompt.HideButton[3] = true;
         this.Wires.localScale     = new Vector3(this.Wires.localScale.x, this.Wires.localScale.y, 1f);
         this.Panel.useGravity     = true;
         this.Panel.AddForce(0f, 0f, 10f);
     }
 }
 // Token: 0x060013CE RID: 5070 RVA: 0x000AC6A0 File Offset: 0x000AA8A0
 private void Update()
 {
     if (!this.Clock.StopTime && this.EventCheck && this.Clock.HourTime > this.StartTime)
     {
         if (this.EventStudent[1] == null)
         {
             this.EventStudent[1] = this.StudentManager.Students[this.EventStudent1];
         }
         else if (!this.EventStudent[1].Alive)
         {
             this.EventCheck = false;
             base.enabled    = false;
         }
         if (this.EventStudent[2] == null)
         {
             this.EventStudent[2] = this.StudentManager.Students[this.EventStudent2];
         }
         else if (!this.EventStudent[2].Alive)
         {
             this.EventCheck = false;
             base.enabled    = false;
         }
         if (this.EventStudent[1] != null && this.EventStudent[2] != null && !this.EventStudent[1].Slave && !this.EventStudent[2].Slave && this.EventStudent[1].Indoors && !this.EventStudent[1].Wet && !this.EventStudent[1].Meeting && (this.OsanaID < 2 || (this.OsanaID > 1 && Vector3.Distance(this.EventStudent[1].transform.position, this.EventLocation[1].position) < 1f)))
         {
             this.StartTimer += Time.deltaTime;
             if (this.StartTimer > 1f && this.EventStudent[1].Routine && this.EventStudent[2].Routine && !this.EventStudent[1].InEvent && !this.EventStudent[2].InEvent)
             {
                 this.EventStudent[1].CurrentDestination = this.EventLocation[1];
                 this.EventStudent[1].Pathfinding.target = this.EventLocation[1];
                 this.EventStudent[1].EventManager       = this;
                 this.EventStudent[1].InEvent            = true;
                 this.EventStudent[1].EmptyHands();
                 if (!this.Osana)
                 {
                     this.EventStudent[2].CurrentDestination = this.EventLocation[2];
                     this.EventStudent[2].Pathfinding.target = this.EventLocation[2];
                     this.EventStudent[2].EventManager       = this;
                     this.EventStudent[2].InEvent            = true;
                 }
                 else
                 {
                     Debug.Log("One of Osana's ''talk privately with Raibaru'' events is beginning.");
                 }
                 this.EventStudent[2].EmptyHands();
                 this.EventStudent[1].SpeechLines.Stop();
                 this.EventStudent[2].SpeechLines.Stop();
                 this.EventCheck = false;
                 this.EventOn    = true;
             }
         }
     }
     if (this.EventOn)
     {
         float num = Vector3.Distance(this.Yandere.transform.position, this.EventStudent[this.EventSpeaker[this.EventPhase]].transform.position);
         if (this.Clock.HourTime > this.EndTime || this.EventStudent[1].WitnessedCorpse || this.EventStudent[2].WitnessedCorpse || this.EventStudent[1].Dying || this.EventStudent[2].Dying || this.EventStudent[1].Splashed || this.EventStudent[2].Splashed || this.EventStudent[1].Alarmed || this.EventStudent[2].Alarmed)
         {
             this.EndEvent();
             return;
         }
         if (this.Osana && this.EventStudent[1].DistanceToDestination < 1f)
         {
             this.EventStudent[2].CurrentDestination = this.EventLocation[2];
             this.EventStudent[2].Pathfinding.target = this.EventLocation[2];
             this.EventStudent[2].EventManager       = this;
             this.EventStudent[2].InEvent            = true;
         }
         if (!this.EventStudent[1].Pathfinding.canMove && !this.EventStudent[1].Private)
         {
             this.EventStudent[1].CharacterAnimation.CrossFade(this.EventStudent[1].IdleAnim);
             this.EventStudent[1].Private = true;
             this.StudentManager.UpdateStudents(0);
         }
         if (Vector3.Distance(this.EventStudent[2].transform.position, this.EventLocation[2].position) < 1f && !this.EventStudent[2].Pathfinding.canMove && !this.StopWalking)
         {
             this.StopWalking = true;
             this.EventStudent[2].CharacterAnimation.CrossFade(this.EventStudent[2].IdleAnim);
             this.EventStudent[2].Private = true;
             this.StudentManager.UpdateStudents(0);
         }
         if (this.StopWalking && this.EventPhase == 1)
         {
             this.EventStudent[2].CharacterAnimation.CrossFade(this.EventStudent[2].IdleAnim);
         }
         if (Vector3.Distance(this.EventStudent[1].transform.position, this.EventLocation[1].position) < 1f && !this.EventStudent[1].Pathfinding.canMove && !this.EventStudent[2].Pathfinding.canMove)
         {
             if (this.EventPhase == 1)
             {
                 this.EventStudent[1].CharacterAnimation.CrossFade(this.EventStudent[1].IdleAnim);
             }
             if (this.Osana)
             {
                 this.SettleFriend();
             }
             if (!this.Spoken)
             {
                 this.EventStudent[this.EventSpeaker[this.EventPhase]].CharacterAnimation.CrossFade(this.EventAnim[this.EventPhase]);
                 if (num < 10f)
                 {
                     this.EventSubtitle.text = this.EventSpeech[this.EventPhase];
                 }
                 AudioClipPlayer.Play(this.EventClip[this.EventPhase], this.EventStudent[this.EventSpeaker[this.EventPhase]].transform.position + Vector3.up * 1.5f, 5f, 10f, out this.VoiceClip, this.Yandere.transform.position.y);
                 this.Spoken = true;
             }
             else
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > this.EventClip[this.EventPhase].length)
                 {
                     this.EventSubtitle.text = string.Empty;
                 }
                 if (this.Yandere.transform.position.y < this.EventStudent[1].transform.position.y - 1f)
                 {
                     this.EventSubtitle.transform.localScale = Vector3.zero;
                 }
                 else if (num < 10f)
                 {
                     this.Scale = Mathf.Abs((num - 10f) * 0.2f);
                     if (this.Scale < 0f)
                     {
                         this.Scale = 0f;
                     }
                     if (this.Scale > 1f)
                     {
                         this.Scale = 1f;
                     }
                     this.Jukebox.Dip = 1f - 0.5f * this.Scale;
                     this.EventSubtitle.transform.localScale = new Vector3(this.Scale, this.Scale, this.Scale);
                 }
                 else
                 {
                     this.EventSubtitle.transform.localScale = Vector3.zero;
                 }
                 Animation characterAnimation = this.EventStudent[this.EventSpeaker[this.EventPhase]].CharacterAnimation;
                 if (characterAnimation[this.EventAnim[this.EventPhase]].time >= characterAnimation[this.EventAnim[this.EventPhase]].length - 1f)
                 {
                     characterAnimation.CrossFade(this.EventStudent[this.EventSpeaker[this.EventPhase]].IdleAnim, 1f);
                 }
                 if (this.Timer > this.EventClip[this.EventPhase].length + 1f)
                 {
                     this.Spoken = false;
                     this.EventPhase++;
                     this.Timer = 0f;
                     if (this.EventPhase == this.EventSpeech.Length)
                     {
                         this.EndEvent();
                     }
                 }
                 if (!this.Suitor && this.Yandere.transform.position.y > this.EventStudent[1].transform.position.y - 1f && this.EventPhase == 7 && num < 5f)
                 {
                     if (this.EventStudent1 == 25)
                     {
                         if (!EventGlobals.Event1)
                         {
                             this.Yandere.NotificationManager.DisplayNotification(NotificationType.Info);
                             EventGlobals.Event1 = true;
                         }
                     }
                     else if (this.OsanaID < 2 && !EventGlobals.OsanaEvent2)
                     {
                         this.Yandere.NotificationManager.DisplayNotification(NotificationType.Info);
                         EventGlobals.OsanaEvent2 = true;
                     }
                 }
             }
             if (base.enabled)
             {
                 if (num < 3f)
                 {
                     this.Yandere.Eavesdropping = true;
                     return;
                 }
                 this.Yandere.Eavesdropping = false;
             }
         }
     }
 }
 // Token: 0x060000DC RID: 220 RVA: 0x000102D8 File Offset: 0x0000E6D8
 private void Update()
 {
     if (!this.Clock.StopTime && !this.EventActive && this.Clock.HourTime > this.EventTime)
     {
         this.EventStudent = this.StudentManager.Students[7];
         if (this.EventStudent != null && !this.EventStudent.Distracted && !this.EventStudent.Talking && !this.EventStudent.Meeting && this.EventStudent.Indoors)
         {
             if (!this.EventStudent.WitnessedMurder)
             {
                 this.OriginalPosition = this.EventStudent.Cosmetic.FemaleAccessories[3].transform.localPosition;
                 this.EventStudent.CurrentDestination = this.StudentManager.StripSpot;
                 this.EventStudent.Pathfinding.target = this.StudentManager.StripSpot;
                 this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventStudent.WalkAnim);
                 this.EventStudent.Pathfinding.canSearch = true;
                 this.EventStudent.Pathfinding.canMove   = true;
                 this.EventStudent.Pathfinding.speed     = 1f;
                 this.EventStudent.DistanceToDestination = 100f;
                 this.EventStudent.Obstacle.checkTime    = 99f;
                 this.EventStudent.InEvent = true;
                 this.EventStudent.Private = true;
                 this.EventStudent.Prompt.Hide();
                 this.EventStudent.Hearts.Stop();
                 this.EventActive = true;
                 if (this.EventStudent.Following)
                 {
                     this.EventStudent.Pathfinding.canMove = true;
                     this.EventStudent.Pathfinding.speed   = 1f;
                     this.EventStudent.Following           = false;
                     this.EventStudent.Routine             = true;
                     this.Yandere.Followers--;
                     this.EventStudent.Subtitle.UpdateLabel(SubtitleType.StopFollowApology, 0, 3f);
                     this.EventStudent.Prompt.Label[0].text = "     Talk";
                 }
             }
             else
             {
                 base.enabled = false;
             }
         }
     }
     if (this.EventActive)
     {
         if (this.Clock.HourTime > this.EventTime + 1f || this.EventStudent.WitnessedMurder || this.EventStudent.Splashed || this.EventStudent.Alarmed || this.EventStudent.Dying || !this.EventStudent.Alive)
         {
             this.EndEvent();
         }
         else
         {
             if (this.EventStudent.DistanceToDestination < 0.5f)
             {
                 if (this.EventPhase == 1)
                 {
                     this.EventStudent.Routine    = false;
                     this.EventStudent.BathePhase = 1;
                     this.EventStudent.Wet        = true;
                     this.EventPhase++;
                 }
                 else if (this.EventPhase == 2)
                 {
                     if (this.EventStudent.BathePhase == 4)
                     {
                         this.RivalPhone.SetActive(true);
                         this.EventPhase++;
                     }
                 }
                 else if (this.EventPhase == 3 && !this.EventStudent.Wet)
                 {
                     if (!this.RivalPhone.activeInHierarchy)
                     {
                         this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventAnim[0]);
                         this.EventStudent.Pathfinding.canSearch = false;
                         this.EventStudent.Pathfinding.canMove   = false;
                         this.EventStudent.Routine = false;
                         this.StudentManager.CommunalLocker.Open = true;
                         this.EventSubtitle.text = this.EventSpeech[0];
                         AudioClipPlayer.Play(this.EventClip[0], this.EventStudent.transform.position + Vector3.up, 5f, 10f, out this.VoiceClip, out this.CurrentClipLength);
                         this.EventPhase++;
                     }
                     else
                     {
                         this.EndEvent();
                     }
                 }
             }
             if (this.EventPhase == 4)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > this.CurrentClipLength + 1f)
                 {
                     this.EventStudent.Routine = true;
                     this.EndEvent();
                 }
             }
             float num = Vector3.Distance(this.Yandere.transform.position, this.EventStudent.transform.position);
             if (num < 11f)
             {
                 if (num < 10f)
                 {
                     float num2 = Mathf.Abs((num - 10f) * 0.2f);
                     if (num2 < 0f)
                     {
                         num2 = 0f;
                     }
                     if (num2 > 1f)
                     {
                         num2 = 1f;
                     }
                     this.EventSubtitle.transform.localScale = new Vector3(num2, num2, num2);
                 }
                 else
                 {
                     this.EventSubtitle.transform.localScale = Vector3.zero;
                 }
             }
         }
     }
 }
Beispiel #8
0
 public void Play(float volume = 1f)
 {
     AudioClipPlayer.Play(m_clip, m_volume * volume);
 }
 // Token: 0x060018E0 RID: 6368 RVA: 0x000E67C4 File Offset: 0x000E49C4
 private void Update()
 {
     if (!this.Clock.StopTime && this.EventCheck)
     {
         if (this.Clock.HourTime > this.EventTime + 0.5f)
         {
             base.enabled = false;
         }
         else if (this.Clock.HourTime > this.EventTime)
         {
             this.EventStudent = this.StudentManager.Students[this.EventStudentID];
             if (this.EventStudent != null && !this.EventStudent.InEvent && this.EventStudent.DistanceToDestination < 1f && !this.StudentManager.CommunalLocker.RivalPhone.Stolen)
             {
                 this.EventStudent.CharacterAnimation.cullingType = AnimationCullingType.AlwaysAnimate;
                 if (this.EventStudentID == 11)
                 {
                     this.EventFriend = this.StudentManager.Students[this.EventFriendID];
                     if (this.EventFriend != null)
                     {
                         this.EventFriend.CharacterAnimation.CrossFade(this.EventFriend.IdleAnim);
                         this.EventFriend.Pathfinding.canSearch = false;
                         this.EventFriend.Pathfinding.canMove   = false;
                         this.EventFriend.TargetDistance        = 0.5f;
                         this.EventFriend.SpeechLines.Stop();
                         this.EventFriend.PhoneEvent = this;
                         this.EventFriend.CanTalk    = false;
                         this.EventFriend.Routine    = false;
                         this.EventFriend.InEvent    = true;
                         this.EventFriend.Prompt.Hide();
                     }
                 }
                 if (this.EventStudent.Routine && !this.EventStudent.Distracted && !this.EventStudent.Talking && !this.EventStudent.Meeting && !this.EventStudent.Investigating && this.EventStudent.Indoors)
                 {
                     if (!this.EventStudent.WitnessedMurder)
                     {
                         this.EventStudent.CurrentDestination = this.EventStudent.Destinations[this.EventStudent.Phase];
                         this.EventStudent.Pathfinding.target = this.EventStudent.Destinations[this.EventStudent.Phase];
                         this.EventStudent.Obstacle.checkTime = 99f;
                         this.EventStudent.SpeechLines.Stop();
                         this.EventStudent.PhoneEvent = this;
                         this.EventStudent.CanTalk    = false;
                         this.EventStudent.InEvent    = true;
                         this.EventStudent.Prompt.Hide();
                         this.EventCheck  = false;
                         this.EventActive = true;
                         if (this.EventStudent.Following)
                         {
                             this.EventStudent.Pathfinding.canMove = true;
                             this.EventStudent.Pathfinding.speed   = 1f;
                             this.EventStudent.Following           = false;
                             this.EventStudent.Routine             = true;
                             this.Yandere.Followers--;
                             this.EventStudent.Subtitle.UpdateLabel(SubtitleType.StopFollowApology, 0, 3f);
                             this.EventStudent.Prompt.Label[0].text = "     Talk";
                         }
                     }
                     else
                     {
                         base.enabled = false;
                     }
                 }
             }
         }
     }
     if (this.EventActive)
     {
         if (this.EventStudent.DistanceToDestination < 0.5f)
         {
             this.EventStudent.Pathfinding.canSearch = false;
             this.EventStudent.Pathfinding.canMove   = false;
         }
         if (this.Clock.HourTime > this.EventTime + 0.5f || this.EventStudent.WitnessedMurder || this.EventStudent.Splashed || this.EventStudent.Alarmed || this.EventStudent.Dying || !this.EventStudent.Alive)
         {
             this.EndEvent();
             return;
         }
         if (!this.EventStudent.Pathfinding.canMove)
         {
             if (this.EventPhase == 1)
             {
                 this.Timer += Time.deltaTime;
                 this.EventStudent.CharacterAnimation.CrossFade(this.EventAnim[0]);
                 AudioClipPlayer.Play(this.EventClip[0], this.EventStudent.transform.position, 5f, 10f, out this.VoiceClip, out this.CurrentClipLength);
                 this.EventPhase++;
             }
             else if (this.EventPhase == 2)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 1.5f)
                 {
                     this.EventStudent.SmartPhone.SetActive(true);
                     this.EventStudent.SmartPhone.transform.localPosition    = new Vector3(-0.015f, -0.005f, -0.015f);
                     this.EventStudent.SmartPhone.transform.localEulerAngles = new Vector3(0f, -150f, 165f);
                 }
                 if (this.Timer > 2f)
                 {
                     AudioClipPlayer.Play(this.EventClip[1], this.EventStudent.transform.position, 5f, 10f, out this.VoiceClip, out this.CurrentClipLength);
                     this.EventSubtitle.text = this.EventSpeech[1];
                     this.Timer = 0f;
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 3)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > this.CurrentClipLength)
                 {
                     this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventStudent.RunAnim);
                     this.EventStudent.CurrentDestination    = this.EventLocation;
                     this.EventStudent.Pathfinding.target    = this.EventLocation;
                     this.EventStudent.Pathfinding.canSearch = true;
                     this.EventStudent.Pathfinding.canMove   = true;
                     this.EventStudent.Pathfinding.speed     = 4f;
                     this.EventSubtitle.text = string.Empty;
                     this.Timer = 0f;
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 4)
             {
                 if (this.EventStudentID != 11)
                 {
                     this.DumpPoint.enabled = true;
                 }
                 this.EventStudent.Private = true;
                 this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventAnim[2]);
                 AudioClipPlayer.Play(this.EventClip[2], this.EventStudent.transform.position, 5f, 10f, out this.VoiceClip, out this.CurrentClipLength);
                 this.EventPhase++;
             }
             else if (this.EventPhase < 13)
             {
                 if (this.VoiceClip != null)
                 {
                     this.VoiceClip.GetComponent <AudioSource>().pitch = Time.timeScale;
                     this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[2]].time = this.VoiceClip.GetComponent <AudioSource>().time;
                     if (this.VoiceClip.GetComponent <AudioSource>().time > this.SpeechTimes[this.EventPhase - 3])
                     {
                         this.EventSubtitle.text = this.EventSpeech[this.EventPhase - 3];
                         this.EventPhase++;
                     }
                 }
             }
             else
             {
                 if (this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[2]].time >= this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[2]].length * 90.33333f)
                 {
                     this.EventStudent.SmartPhone.SetActive(true);
                 }
                 if (this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[2]].time >= this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[2]].length)
                 {
                     this.EndEvent();
                 }
             }
             float num = Vector3.Distance(this.Yandere.transform.position, this.EventStudent.transform.position);
             if (num < 10f)
             {
                 float num2 = Mathf.Abs((num - 10f) * 0.2f);
                 if (num2 < 0f)
                 {
                     num2 = 0f;
                 }
                 if (num2 > 1f)
                 {
                     num2 = 1f;
                 }
                 this.Jukebox.Dip = 1f - 0.5f * num2;
                 this.EventSubtitle.transform.localScale = new Vector3(num2, num2, num2);
             }
             else
             {
                 this.EventSubtitle.transform.localScale = Vector3.zero;
             }
             if (base.enabled && this.EventPhase > 4)
             {
                 if (num < 5f)
                 {
                     this.Yandere.Eavesdropping = true;
                 }
                 else
                 {
                     this.Yandere.Eavesdropping = false;
                 }
             }
             if (this.EventPhase == 11 && num < 5f)
             {
                 if (this.EventStudentID == 30)
                 {
                     if (!EventGlobals.Event2)
                     {
                         EventGlobals.Event2 = true;
                         this.Yandere.NotificationManager.DisplayNotification(NotificationType.Info);
                         ConversationGlobals.SetTopicDiscovered(25, true);
                         this.Yandere.NotificationManager.TopicName = "Money";
                         this.Yandere.NotificationManager.DisplayNotification(NotificationType.Topic);
                         this.Yandere.NotificationManager.TopicName = "Money";
                         this.Yandere.NotificationManager.DisplayNotification(NotificationType.Opinion);
                         ConversationGlobals.SetTopicLearnedByStudent(25, this.EventStudentID, true);
                     }
                 }
                 else if (!EventGlobals.OsanaEvent1)
                 {
                     EventGlobals.OsanaEvent1 = true;
                     this.Yandere.NotificationManager.DisplayNotification(NotificationType.Info);
                 }
             }
         }
         if ((this.EventStudent.Pathfinding.canMove || this.EventPhase > 3) && this.EventFriend != null && this.EventPhase > 3)
         {
             if (this.EventFriend.CurrentDestination != this.SpyLocation)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 3f)
                 {
                     this.EventFriend.CharacterAnimation.CrossFade(this.EventStudent.RunAnim);
                     this.EventFriend.CurrentDestination    = this.SpyLocation;
                     this.EventFriend.Pathfinding.target    = this.SpyLocation;
                     this.EventFriend.Pathfinding.canSearch = true;
                     this.EventFriend.Pathfinding.canMove   = true;
                     this.EventFriend.Pathfinding.speed     = 4f;
                     this.EventFriend.Routine = true;
                     this.Timer = 0f;
                     return;
                 }
                 this.EventFriend.targetRotation     = Quaternion.LookRotation(this.StudentManager.Students[this.EventStudentID].transform.position - this.EventFriend.transform.position);
                 this.EventFriend.transform.rotation = Quaternion.Slerp(this.EventFriend.transform.rotation, this.EventFriend.targetRotation, 10f * Time.deltaTime);
                 return;
             }
             else if (this.EventFriend.DistanceToDestination < 1f)
             {
                 this.EventFriend.CharacterAnimation.CrossFade("f02_cornerPeek_00");
                 this.EventFriend.Pathfinding.canSearch = false;
                 this.EventFriend.Pathfinding.canMove   = false;
                 this.SettleFriend();
             }
         }
     }
 }
 // Token: 0x06001C6F RID: 7279 RVA: 0x00155614 File Offset: 0x00153814
 private void Update()
 {
     if (!this.Clock.StopTime && this.EventCheck && this.Clock.HourTime > this.EventTime)
     {
         this.EventStudent = this.StudentManager.Students[30];
         if (this.EventStudent != null && this.EventStudent.Routine && !this.EventStudent.Distracted && !this.EventStudent.Talking && !this.EventStudent.Alarmed && !this.EventStudent.Meeting)
         {
             if (!this.EventStudent.WitnessedMurder)
             {
                 this.EventStudent.CharacterAnimation.CrossFade(this.EventStudent.WalkAnim);
                 this.EventStudent.CurrentDestination    = this.EventLocation[1];
                 this.EventStudent.Pathfinding.target    = this.EventLocation[1];
                 this.EventStudent.Pathfinding.canSearch = true;
                 this.EventStudent.Pathfinding.canMove   = true;
                 this.EventStudent.LightSwitch           = this.LightSwitch;
                 this.EventStudent.Obstacle.checkTime    = 99f;
                 this.EventStudent.SpeechLines.Stop();
                 this.EventStudent.ToiletEvent = this;
                 this.EventStudent.InEvent     = true;
                 this.EventStudent.Prompt.Hide();
                 this.Prompt.enabled = true;
                 this.EventCheck     = false;
                 this.EventActive    = true;
                 if (this.EventStudent.Following)
                 {
                     this.EventStudent.Pathfinding.speed = 1f;
                     this.EventStudent.Following         = false;
                     this.EventStudent.Routine           = true;
                     this.Yandere.Followers--;
                     this.EventStudent.Subtitle.UpdateLabel(SubtitleType.StopFollowApology, 0, 3f);
                     this.EventStudent.Prompt.Label[0].text = "     Talk";
                 }
             }
             else
             {
                 base.enabled = false;
             }
         }
     }
     if (this.EventActive)
     {
         if (this.Prompt.Circle[0].fillAmount == 0f)
         {
             this.Yandere.EmptyHands();
             this.Prompt.Hide();
             this.Prompt.enabled = false;
             this.EventPhase     = 5;
             this.Timer          = 0f;
             AudioClipPlayer.Play(this.EventClip[1], this.EventStudent.transform.position + Vector3.up * 1.5f, 5f, 10f, out this.VoiceClip);
             this.EventSubtitle.text = this.EventSpeech[1];
             this.EventStudent.MyController.enabled = false;
             this.EventStudent.Distracted           = true;
             this.EventStudent.Routine   = false;
             this.EventStudent.Drowned   = true;
             this.Yandere.TargetStudent  = this.EventStudent;
             this.Yandere.Attacking      = true;
             this.Yandere.CanMove        = false;
             this.Yandere.Drown          = true;
             this.Yandere.DrownAnim      = "f02_toiletDrownA_00";
             this.EventStudent.DrownAnim = "f02_toiletDrownB_00";
             this.EventStudent.CharacterAnimation.CrossFade(this.EventStudent.DrownAnim);
         }
         if (this.Clock.HourTime > this.EventTime + 0.5f || this.EventStudent.WitnessedMurder || this.EventStudent.Splashed || this.EventStudent.Dying || this.EventStudent.Alarmed)
         {
             this.EndEvent();
         }
         else if (!this.EventStudent.Pathfinding.canMove)
         {
             if (this.EventPhase == 1)
             {
                 if (this.Timer == 0f)
                 {
                     this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventStudent.IdleAnim);
                     this.Prompt.HideButton[0] = false;
                     this.EventStudent.Prompt.Hide();
                     this.EventStudent.Prompt.enabled = false;
                     this.StallDoor.Prompt.enabled    = false;
                     this.StallDoor.Prompt.Hide();
                 }
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 3f)
                 {
                     this.StallDoor.Locked = true;
                     this.StallDoor.CloseDoor();
                     this.Toilet.enabled = false;
                     this.Prompt.Hide();
                     this.Prompt.enabled = false;
                     this.EventStudent.CurrentDestination = this.EventLocation[2];
                     this.EventStudent.Pathfinding.target = this.EventLocation[2];
                     this.EventStudent.TargetDistance     = 2f;
                     this.EventPhase++;
                     this.Timer = 0f;
                 }
             }
             else if (this.EventPhase == 2)
             {
                 if (this.Timer == 0f)
                 {
                     this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventAnim[1]);
                     this.BucketPour.enabled = true;
                 }
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 10f)
                 {
                     AudioClipPlayer.Play(this.EventClip[2], this.Toilet.transform.position, 5f, 10f, out this.VoiceClip);
                     this.EventPhase++;
                     this.Timer = 0f;
                 }
             }
             else if (this.EventPhase == 3)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 4f)
                 {
                     this.EventStudent.CurrentDestination = this.EventLocation[3];
                     this.EventStudent.Pathfinding.target = this.EventLocation[3];
                     this.EventStudent.TargetDistance     = 2f;
                     this.StallDoor.gameObject.SetActive(true);
                     this.StallDoor.Prompt.enabled = true;
                     this.StallDoor.Locked         = false;
                     this.EventPhase++;
                     this.Timer = 0f;
                 }
             }
             else if (this.EventPhase == 4)
             {
                 this.EventStudent.Character.GetComponent <Animation>().CrossFade("f02_washHands_00");
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 5f)
                 {
                     this.EndEvent();
                 }
             }
             else if (this.EventPhase == 5)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 9f)
                 {
                     this.Splashes.Stop();
                     this.EventOver = true;
                     this.EndEvent();
                 }
                 else if (this.Timer > 3f)
                 {
                     this.EventSubtitle.text = string.Empty;
                     this.Splashes.Play();
                 }
             }
             this.Distance = Vector3.Distance(this.Yandere.transform.position, this.EventStudent.transform.position);
             if (this.Distance < 10f)
             {
                 float num = Mathf.Abs((this.Distance - 10f) * 0.2f);
                 if (num < 0f)
                 {
                     num = 0f;
                 }
                 if (num > 1f)
                 {
                     num = 1f;
                 }
                 this.EventSubtitle.transform.localScale = new Vector3(num, num, num);
             }
             else
             {
                 this.EventSubtitle.transform.localScale = Vector3.zero;
             }
         }
     }
     if (this.ToiletCountdown > 0f)
     {
         this.ToiletCountdown -= Time.deltaTime;
         if (this.ToiletCountdown < 0f)
         {
             this.Toilet.enabled = true;
         }
     }
 }
 // Token: 0x060009EF RID: 2543 RVA: 0x0004E4E8 File Offset: 0x0004C6E8
 private void Update()
 {
     if (!this.EventOn)
     {
         for (int i = 1; i < 3; i++)
         {
             if (this.EventStudent[i] == null)
             {
                 this.EventStudent[i] = this.StudentManager.Students[this.StudentID[i]];
             }
             else if (!this.EventStudent[i].Alive || this.EventStudent[i].Slave)
             {
                 base.enabled = false;
             }
         }
         if (this.Clock.HourTime > 13.001f && this.EventStudent[1] != null && this.EventStudent[2] != null && this.EventStudent[1].Pathfinding.canMove && this.EventStudent[2].Pathfinding.canMove)
         {
             this.EventStudent[1].CharacterAnimation.CrossFade(this.EventStudent[1].WalkAnim);
             this.EventStudent[1].CurrentDestination = this.EventLocation[1];
             this.EventStudent[1].Pathfinding.target = this.EventLocation[1];
             this.EventStudent[1].InEvent            = true;
             this.EventStudent[2].CharacterAnimation.CrossFade(this.EventStudent[2].WalkAnim);
             this.EventStudent[2].CurrentDestination = this.EventLocation[2];
             this.EventStudent[2].Pathfinding.target = this.EventLocation[2];
             this.EventStudent[2].InEvent            = true;
             this.EventOn = true;
             return;
         }
     }
     else
     {
         float num = Vector3.Distance(this.Yandere.transform.position, this.EventLocation[1].parent.position);
         if (this.Clock.HourTime > 13.5f || this.EventStudent[1].WitnessedCorpse || this.EventStudent[2].WitnessedCorpse || this.EventStudent[1].Alarmed || this.EventStudent[2].Alarmed || this.EventStudent[1].Dying || this.EventStudent[2].Dying)
         {
             this.EndEvent();
             return;
         }
         for (int j = 1; j < 3; j++)
         {
             if (!this.EventStudent[j].Pathfinding.canMove && !this.EventStudent[j].Private)
             {
                 this.EventStudent[j].Character.GetComponent <Animation>().CrossFade(this.EventStudent[j].IdleAnim);
                 this.EventStudent[j].Private = true;
                 this.StudentManager.UpdateStudents(0);
             }
         }
         if (!this.EventStudent[1].Pathfinding.canMove && !this.EventStudent[2].Pathfinding.canMove)
         {
             if (!this.Spoken)
             {
                 this.EventStudent[this.EventSpeaker[1]].CharacterAnimation.CrossFade(this.EventStudent[1].IdleAnim);
                 this.EventStudent[this.EventSpeaker[2]].CharacterAnimation.CrossFade(this.EventStudent[2].IdleAnim);
                 this.EventStudent[this.EventSpeaker[this.EventPhase]].PickRandomAnim();
                 this.EventStudent[this.EventSpeaker[this.EventPhase]].CharacterAnimation.CrossFade(this.EventStudent[this.EventSpeaker[this.EventPhase]].RandomAnim);
                 if (DateGlobals.Weekday == DayOfWeek.Monday && this.EventPhase == 13)
                 {
                     this.EventStudent[this.EventSpeaker[this.EventPhase]].CharacterAnimation.CrossFade("jojoPose_00");
                 }
                 AudioClipPlayer.Play(this.EventClip[this.EventPhase], this.EventStudent[this.EventSpeaker[this.EventPhase]].transform.position + Vector3.up * 1.5f, 5f, 10f, out this.VoiceClip, this.Yandere.transform.position.y);
                 this.Spoken = true;
                 return;
             }
             int num2 = this.EventSpeaker[this.EventPhase];
             if (this.EventStudent[num2].CharacterAnimation[this.EventStudent[num2].RandomAnim].time >= this.EventStudent[num2].CharacterAnimation[this.EventStudent[num2].RandomAnim].length)
             {
                 this.EventStudent[num2].PickRandomAnim();
                 this.EventStudent[num2].CharacterAnimation.CrossFade(this.EventStudent[num2].RandomAnim);
             }
             this.Timer += Time.deltaTime;
             if (this.Yandere.transform.position.y > this.EventLocation[1].parent.position.y - 1f && this.Yandere.transform.position.y < this.EventLocation[1].parent.position.y + 1f)
             {
                 if (this.VoiceClip != null)
                 {
                     this.VoiceClip.GetComponent <AudioSource>().volume = 1f;
                 }
                 if (num < 10f)
                 {
                     if (this.Timer > this.EventClip[this.EventPhase].length)
                     {
                         this.EventSubtitle.text = string.Empty;
                     }
                     else
                     {
                         this.EventSubtitle.text = this.EventSpeech[this.EventPhase];
                     }
                     this.Scale = Mathf.Abs((num - 10f) * 0.2f);
                     if (this.Scale < 0f)
                     {
                         this.Scale = 0f;
                     }
                     if (this.Scale > 1f)
                     {
                         this.Scale = 1f;
                     }
                     this.EventSubtitle.transform.localScale = new Vector3(this.Scale, this.Scale, this.Scale);
                 }
                 else
                 {
                     this.EventSubtitle.transform.localScale = Vector3.zero;
                     this.EventSubtitle.text = string.Empty;
                 }
             }
             else if (this.VoiceClip != null)
             {
                 this.VoiceClip.GetComponent <AudioSource>().volume = 0f;
             }
             if (this.Timer > this.EventClip[this.EventPhase].length + 0.5f)
             {
                 this.Spoken = false;
                 this.EventPhase++;
                 this.Timer = 0f;
                 if (this.EventPhase == this.EventSpeech.Length)
                 {
                     this.EndEvent();
                 }
             }
         }
     }
 }
 // Token: 0x060009F1 RID: 2545 RVA: 0x0004E888 File Offset: 0x0004CA88
 private void Update()
 {
     if (!this.EventOn)
     {
         for (int i = 1; i < 3; i++)
         {
             if (this.EventStudent[i] == null)
             {
                 this.EventStudent[i] = this.StudentManager.Students[this.StudentID[i]];
             }
             else if (!this.EventStudent[i].Alive || this.EventStudent[i].Slave)
             {
                 base.enabled = false;
             }
         }
         if (this.Clock.HourTime > this.StartTime && this.EventStudent[1] != null && this.EventStudent[2] != null && this.EventStudent[1].Indoors && this.EventStudent[2].Indoors && this.EventStudent[1].Pathfinding.canMove && this.EventStudent[2].Pathfinding.canMove)
         {
             if (this.Sitting && this.Yandere.Hiding && this.Yandere.HidingSpot == this.HidingSpot.Spot)
             {
                 this.Yandere.PromptBar.ClearButtons();
                 this.Yandere.PromptBar.Show    = false;
                 this.Yandere.Exiting           = true;
                 this.HidingSpot.Prompt.enabled = false;
                 this.HidingSpot.Prompt.Hide();
             }
             this.EventStudent[1].CharacterAnimation.CrossFade(this.EventStudent[1].WalkAnim);
             this.EventStudent[1].CurrentDestination = this.EventLocation[1];
             this.EventStudent[1].Pathfinding.target = this.EventLocation[1];
             this.EventStudent[1].InEvent            = true;
             this.EventStudent[2].CharacterAnimation.CrossFade(this.EventStudent[2].WalkAnim);
             this.EventStudent[2].CurrentDestination = this.EventLocation[2];
             this.EventStudent[2].Pathfinding.target = this.EventLocation[2];
             this.EventStudent[2].InEvent            = true;
             this.EventOn = true;
             return;
         }
     }
     else
     {
         float num = Vector3.Distance(this.Yandere.transform.position, this.EventLocation[1].parent.position);
         if (this.Clock.HourTime > this.StartTime + 0.5f || this.EventStudent[1].WitnessedCorpse || this.EventStudent[2].WitnessedCorpse || this.EventStudent[1].Alarmed || this.EventStudent[2].Alarmed || this.EventStudent[1].Dying || this.EventStudent[2].Dying)
         {
             this.EndEvent();
             return;
         }
         for (int j = 1; j < 3; j++)
         {
             if (!this.EventStudent[j].Pathfinding.canMove && !this.EventStudent[j].Private)
             {
                 this.EventStudent[j].Character.GetComponent <Animation>().CrossFade(this.EventStudent[j].IdleAnim);
                 this.EventStudent[j].Private = true;
                 this.StudentManager.UpdateStudents(0);
             }
         }
         if (!this.EventStudent[1].Pathfinding.canMove && !this.EventStudent[2].Pathfinding.canMove)
         {
             if (this.Sitting)
             {
                 this.EventStudent[1].CharacterAnimation.cullingType = AnimationCullingType.AlwaysAnimate;
                 this.EventStudent[1].CharacterAnimation[this.EventStudent[1].SocialSitAnim].layer = 99;
                 this.EventStudent[1].CharacterAnimation.Play(this.EventStudent[1].SocialSitAnim);
                 this.EventStudent[1].CharacterAnimation[this.EventStudent[1].SocialSitAnim].weight = 1f;
                 this.EventStudent[2].CharacterAnimation.cullingType = AnimationCullingType.AlwaysAnimate;
                 this.EventStudent[2].CharacterAnimation[this.EventStudent[2].SocialSitAnim].layer = 99;
                 this.EventStudent[2].CharacterAnimation.Play(this.EventStudent[2].SocialSitAnim);
                 this.EventStudent[2].CharacterAnimation[this.EventStudent[2].SocialSitAnim].weight = 1f;
                 this.EventStudent[1].MyController.radius = 0f;
                 this.EventStudent[2].MyController.radius = 0f;
                 this.RotateSpine = true;
             }
             if (!this.Spoken)
             {
                 if (this.Sitting)
                 {
                     this.EventStudent[this.EventSpeaker[1]].CharacterAnimation.CrossFade("f02_benchSit_00");
                     this.EventStudent[this.EventSpeaker[2]].CharacterAnimation.CrossFade("f02_benchSit_00");
                 }
                 else
                 {
                     this.EventStudent[this.EventSpeaker[1]].CharacterAnimation.CrossFade(this.EventStudent[1].IdleAnim);
                     this.EventStudent[this.EventSpeaker[2]].CharacterAnimation.CrossFade(this.EventStudent[2].IdleAnim);
                 }
                 this.EventStudent[this.EventSpeaker[this.EventPhase]].PickRandomAnim();
                 this.EventStudent[this.EventSpeaker[this.EventPhase]].CharacterAnimation.CrossFade(this.EventStudent[this.EventSpeaker[this.EventPhase]].RandomAnim);
                 if (!this.Sitting && this.StartTime < 16f && DateGlobals.Weekday == DayOfWeek.Monday && this.EventPhase == 13)
                 {
                     this.EventStudent[this.EventSpeaker[this.EventPhase]].CharacterAnimation.CrossFade("jojoPose_00");
                 }
                 AudioClipPlayer.Play(this.EventClip[this.EventPhase], this.EventStudent[this.EventSpeaker[this.EventPhase]].transform.position + Vector3.up * 1.5f, 5f, 10f, out this.VoiceClip, this.Yandere.transform.position.y);
                 this.Spoken = true;
             }
             else
             {
                 int num2 = this.EventSpeaker[this.EventPhase];
                 if (this.EventStudent[num2].CharacterAnimation[this.EventStudent[num2].RandomAnim].time >= this.EventStudent[num2].CharacterAnimation[this.EventStudent[num2].RandomAnim].length)
                 {
                     this.EventStudent[num2].PickRandomAnim();
                     this.EventStudent[num2].CharacterAnimation.CrossFade(this.EventStudent[num2].RandomAnim);
                 }
                 this.Timer += Time.deltaTime;
                 if (this.Yandere.transform.position.y > this.EventLocation[1].parent.position.y - 1f && this.Yandere.transform.position.y < this.EventLocation[1].parent.position.y + 1f)
                 {
                     if (this.VoiceClip != null)
                     {
                         this.VoiceClip.GetComponent <AudioSource>().volume = 1f;
                     }
                     if (num < 10f)
                     {
                         if (this.Timer > this.EventClip[this.EventPhase].length)
                         {
                             this.EventSubtitle.text = string.Empty;
                         }
                         else
                         {
                             this.EventSubtitle.text = this.EventSpeech[this.EventPhase];
                         }
                         this.Scale = Mathf.Abs((num - 10f) * 0.2f);
                         if (this.Scale < 0f)
                         {
                             this.Scale = 0f;
                         }
                         if (this.Scale > 1f)
                         {
                             this.Scale = 1f;
                         }
                         this.EventSubtitle.transform.localScale = new Vector3(this.Scale, this.Scale, this.Scale);
                     }
                     else
                     {
                         this.EventSubtitle.transform.localScale = Vector3.zero;
                         this.EventSubtitle.text = string.Empty;
                     }
                 }
                 else if (this.VoiceClip != null)
                 {
                     this.VoiceClip.GetComponent <AudioSource>().volume = 0f;
                 }
                 if (this.Timer > this.EventClip[this.EventPhase].length + this.Delay)
                 {
                     this.Spoken = false;
                     this.EventPhase++;
                     this.Timer = 0f;
                     if (this.EventPhase == this.EventSpeech.Length)
                     {
                         this.EndEvent();
                     }
                 }
             }
             if (this.Private)
             {
                 if (num < 5f)
                 {
                     this.Yandere.Eavesdropping = true;
                     return;
                 }
                 this.Yandere.Eavesdropping = false;
             }
         }
     }
 }
 // Token: 0x060002A9 RID: 681 RVA: 0x000345D8 File Offset: 0x000329D8
 private void Update() {
   if (!this.Clock.StopTime && this.EventCheck) {
     if (this.EventStudent[1] == null) {
       this.EventStudent[1] = this.StudentManager.Students[6];
     } else if (!this.EventStudent[1].Alive) {
       this.EventCheck = false;
       base.enabled = false;
     }
     if (this.EventStudent[2] == null) {
       this.EventStudent[2] = this.StudentManager.Students[7];
     } else if (!this.EventStudent[2].Alive) {
       this.EventCheck = false;
       base.enabled = false;
     }
     if (this.Clock.HourTime > 13.01f && this.EventStudent[1] != null && this.EventStudent[2] != null && this.EventStudent[1].Pathfinding.canMove && this.EventStudent[1].Pathfinding.canMove) {
       this.EventStudent[1].CurrentDestination = this.EventLocation[1];
       this.EventStudent[1].Pathfinding.target = this.EventLocation[1];
       this.EventStudent[1].EventManager = this;
       this.EventStudent[1].InEvent = true;
       this.EventStudent[2].CurrentDestination = this.EventLocation[2];
       this.EventStudent[2].Pathfinding.target = this.EventLocation[2];
       this.EventStudent[2].EventManager = this;
       this.EventStudent[2].InEvent = true;
       this.EventCheck = false;
       this.EventOn = true;
     }
   }
   if (this.EventOn) {
     float num = Vector3.Distance(this.Yandere.transform.position, this.EventStudent[this.EventSpeaker[this.EventPhase]].transform.position);
     if (this.Clock.HourTime > 13.5f || this.EventStudent[1].WitnessedCorpse || this.EventStudent[2].WitnessedCorpse || this.EventStudent[1].Dying || this.EventStudent[2].Dying || this.EventStudent[2].Splashed) {
       this.EndEvent();
     } else {
       if (!this.EventStudent[1].Pathfinding.canMove && !this.EventStudent[1].Private) {
         this.EventStudent[1].Character.GetComponent<Animation>().CrossFade(this.EventStudent[1].IdleAnim);
         this.EventStudent[1].Private = true;
         this.StudentManager.UpdateStudents();
       }
       if (!this.EventStudent[2].Pathfinding.canMove && !this.EventStudent[2].Private) {
         this.EventStudent[2].Character.GetComponent<Animation>().CrossFade(this.EventStudent[2].IdleAnim);
         this.EventStudent[2].Private = true;
         this.StudentManager.UpdateStudents();
       }
       if (!this.EventStudent[1].Pathfinding.canMove && !this.EventStudent[2].Pathfinding.canMove) {
         if (!this.InterruptZone.activeInHierarchy) {
           this.InterruptZone.SetActive(true);
         }
         if (!this.Spoken) {
           this.EventStudent[this.EventSpeaker[this.EventPhase]].Character.GetComponent<Animation>().CrossFade(this.EventAnim[this.EventPhase]);
           if (num < 10f) {
             this.EventSubtitle.text = this.EventSpeech[this.EventPhase];
           }
           AudioClipPlayer.Play(this.EventClip[this.EventPhase], this.EventStudent[this.EventSpeaker[this.EventPhase]].transform.position + Vector3.up * 1.5f, 5f, 10f, out this.VoiceClip, this.Yandere.transform.position.y);
           this.Spoken = true;
         } else {
           if (this.Yandere.transform.position.z > 0f) {
             this.Timer += Time.deltaTime;
             if (this.Timer > this.EventClip[this.EventPhase].length) {
               this.EventSubtitle.text = string.Empty;
             }
             if (this.Yandere.transform.position.y < this.EventStudent[1].transform.position.y - 1f) {
               this.EventSubtitle.transform.localScale = Vector3.zero;
             } else if (num < 10f) {
               this.Scale = Mathf.Abs((num - 10f) * 0.2f);
               if (this.Scale < 0f) {
                 this.Scale = 0f;
               }
               if (this.Scale > 1f) {
                 this.Scale = 1f;
               }
               this.EventSubtitle.transform.localScale = new Vector3(this.Scale, this.Scale, this.Scale);
             } else {
               this.EventSubtitle.transform.localScale = Vector3.zero;
             }
             Animation component = this.EventStudent[this.EventSpeaker[this.EventPhase]].Character.GetComponent<Animation>();
             if (component[this.EventAnim[this.EventPhase]].time >= component[this.EventAnim[this.EventPhase]].length) {
               component.CrossFade(this.EventStudent[this.EventSpeaker[this.EventPhase]].IdleAnim);
             }
             if (this.Timer > this.EventClip[this.EventPhase].length + 1f) {
               this.Spoken = false;
               this.EventPhase++;
               this.Timer = 0f;
               if (this.EventPhase == 4) {
                 if (!ConversationGlobals.GetTopicDiscovered(22)) {
                   this.Yandere.NotificationManager.DisplayNotification(NotificationType.Topic);
                   ConversationGlobals.SetTopicDiscovered(22, true);
                 }
                 if (!ConversationGlobals.GetTopicLearnedByStudent(22, 7)) {
                   this.Yandere.NotificationManager.DisplayNotification(NotificationType.Opinion);
                   ConversationGlobals.SetTopicLearnedByStudent(22, 7, true);
                 }
               }
               if (this.EventPhase == this.EventSpeech.Length) {
                 this.EndEvent();
               }
             }
           }
           if (this.Yandere.transform.position.y > this.EventStudent[1].transform.position.y - 1f && this.EventPhase == 7 && num < 5f && !EventGlobals.Event1) {
             this.Yandere.NotificationManager.DisplayNotification(NotificationType.Info);
             EventGlobals.Event1 = true;
           }
         }
       }
     }
   }
 }
Beispiel #14
0
 // Token: 0x060005D8 RID: 1496 RVA: 0x00050A88 File Offset: 0x0004EE88
 private void Update()
 {
     if (!this.Clock.StopTime && this.EventCheck && this.Clock.HourTime > 13f)
     {
         this.EventStudent = this.StudentManager.Students[7];
         if (this.EventStudent != null)
         {
             this.EventStudent.Character.GetComponent <Animation>()[this.EventStudent.BentoAnim].weight = 1f;
             this.EventStudent.CurrentDestination = this.EventLocation[0];
             this.EventStudent.Pathfinding.target = this.EventLocation[0];
             this.EventStudent.Scrubber.SetActive(false);
             this.EventStudent.Phone.SetActive(false);
             this.EventStudent.Bento.SetActive(true);
             this.EventStudent.Pen.SetActive(false);
             this.EventStudent.MovingEvent = this;
             this.EventStudent.InEvent     = true;
             this.EventStudent.Private     = true;
             this.EventCheck  = false;
             this.EventActive = true;
         }
     }
     if (this.EventActive)
     {
         if (this.Prompt.Circle[0].fillAmount == 0f)
         {
             this.Portal.InEvent = true;
             this.Poisoned       = true;
             this.Prompt.Hide();
             this.Prompt.enabled = false;
         }
         if ((this.Clock.HourTime > 13.375f && !this.Poisoned) || this.EventStudent.Dying || this.EventStudent.Splashed)
         {
             this.EndEvent();
         }
         else
         {
             this.Distance = Vector3.Distance(this.Yandere.transform.position, this.EventStudent.transform.position);
             if (!this.EventStudent.Alarmed && this.EventStudent.DistanceToDestination < this.EventStudent.TargetDistance && !this.EventStudent.Pathfinding.canMove)
             {
                 if (this.EventPhase == 0)
                 {
                     this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventStudent.IdleAnim);
                     if (this.Clock.HourTime > 13.05f)
                     {
                         this.EventStudent.CurrentDestination = this.EventLocation[1];
                         this.EventStudent.Pathfinding.target = this.EventLocation[1];
                         this.EventPhase++;
                     }
                 }
                 else if (this.EventPhase == 1)
                 {
                     if (!this.StudentManager.Students[1].WitnessedCorpse)
                     {
                         if (this.Timer == 0f)
                         {
                             AudioClipPlayer.Play(this.EventClip[1], this.EventStudent.transform.position + Vector3.up * 1.5f, 5f, 10f, out this.VoiceClip);
                             this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventStudent.IdleAnim);
                             if (this.Distance < 10f)
                             {
                                 this.EventSubtitle.text = this.EventSpeech[1];
                             }
                             this.EventStudent.Prompt.Hide();
                             this.EventStudent.Prompt.enabled = false;
                         }
                         this.Timer += Time.deltaTime;
                         if (this.Timer > 2f)
                         {
                             this.EventStudent.CurrentDestination = this.EventLocation[2];
                             this.EventStudent.Pathfinding.target = this.EventLocation[2];
                             if (this.Distance < 10f)
                             {
                                 this.EventSubtitle.text = string.Empty;
                             }
                             this.EventPhase++;
                             this.Timer = 0f;
                         }
                     }
                     else
                     {
                         this.EventPhase = 7;
                         this.Timer      = 3f;
                     }
                 }
                 else if (this.EventPhase == 2)
                 {
                     Animation component = this.EventStudent.Character.GetComponent <Animation>();
                     component[this.EventStudent.BentoAnim].weight -= Time.deltaTime;
                     if (this.Timer == 0f)
                     {
                         component.CrossFade("f02_bentoPlace_00");
                     }
                     this.Timer += Time.deltaTime;
                     if (this.Timer > 1f && this.EventStudent.Bento.transform.parent != null)
                     {
                         this.EventStudent.Bento.transform.parent      = null;
                         this.EventStudent.Bento.transform.position    = new Vector3(8f, 0.5f, -2.2965f);
                         this.EventStudent.Bento.transform.eulerAngles = new Vector3(0f, 0f, 0f);
                         this.EventStudent.Bento.transform.localScale  = new Vector3(1.4f, 1.5f, 1.4f);
                     }
                     if (this.Timer > 2f)
                     {
                         if (this.Yandere.PossessPoison)
                         {
                             this.Prompt.HideButton[0] = false;
                         }
                         this.EventStudent.CurrentDestination = this.EventLocation[3];
                         this.EventStudent.Pathfinding.target = this.EventLocation[3];
                         this.EventPhase++;
                         this.Timer = 0f;
                     }
                 }
                 else if (this.EventPhase == 3)
                 {
                     AudioClipPlayer.Play(this.EventClip[2], this.EventStudent.transform.position + Vector3.up * 1.5f, 5f, 10f, out this.VoiceClip);
                     this.EventStudent.Character.GetComponent <Animation>().CrossFade("f02_cornerPeek_00");
                     if (this.Distance < 10f)
                     {
                         this.EventSubtitle.text = this.EventSpeech[2];
                     }
                     this.EventPhase++;
                 }
                 else if (this.EventPhase == 4)
                 {
                     this.Timer += Time.deltaTime;
                     if (this.Timer > 5.5f)
                     {
                         AudioClipPlayer.Play(this.EventClip[3], this.EventStudent.transform.position + Vector3.up * 1.5f, 5f, 10f, out this.VoiceClip);
                         if (this.Distance < 10f)
                         {
                             this.EventSubtitle.text = this.EventSpeech[3];
                         }
                         this.EventPhase++;
                         this.Timer = 0f;
                     }
                 }
                 else if (this.EventPhase == 5)
                 {
                     this.Timer += Time.deltaTime;
                     if (this.Timer > 5.5f)
                     {
                         AudioClipPlayer.Play(this.EventClip[4], this.EventStudent.transform.position + Vector3.up * 1.5f, 5f, 10f, out this.VoiceClip);
                         if (this.Distance < 10f)
                         {
                             this.EventSubtitle.text = this.EventSpeech[4];
                         }
                         this.EventPhase++;
                         this.Timer = 0f;
                     }
                 }
                 else if (this.EventPhase == 6)
                 {
                     this.Timer += Time.deltaTime;
                     if (this.Timer > 3f)
                     {
                         this.EventStudent.CurrentDestination = this.EventLocation[2];
                         this.EventStudent.Pathfinding.target = this.EventLocation[2];
                         if (this.Distance < 10f)
                         {
                             this.EventSubtitle.text = string.Empty;
                         }
                         this.EventPhase++;
                         this.Prompt.Hide();
                         this.Prompt.enabled = false;
                         this.Timer          = 0f;
                     }
                 }
                 else if (this.EventPhase == 7)
                 {
                     if (this.Timer == 0f)
                     {
                         Animation component2 = this.EventStudent.Character.GetComponent <Animation>();
                         component2["f02_bentoPlace_00"].time  = component2["f02_bentoPlace_00"].length;
                         component2["f02_bentoPlace_00"].speed = -1f;
                         component2.CrossFade("f02_bentoPlace_00");
                     }
                     this.Timer += Time.deltaTime;
                     if (this.Timer > 1f && this.EventStudent.Bento.transform.parent == null)
                     {
                         this.EventStudent.Bento.transform.parent           = this.EventStudent.LeftHand;
                         this.EventStudent.Bento.transform.localPosition    = new Vector3(0f, -0.0906f, -0.032f);
                         this.EventStudent.Bento.transform.localEulerAngles = new Vector3(0f, 90f, 90f);
                         this.EventStudent.Bento.transform.localScale       = new Vector3(1.4f, 1.5f, 1.4f);
                     }
                     if (this.Timer > 2f)
                     {
                         this.EventStudent.Bento.transform.localPosition    = new Vector3(-0.025f, -0.105f, 0f);
                         this.EventStudent.Bento.transform.localEulerAngles = new Vector3(0f, 165f, 82.5f);
                         this.EventStudent.CurrentDestination = this.EventLocation[4];
                         this.EventStudent.Pathfinding.target = this.EventLocation[4];
                         this.EventStudent.Prompt.Hide();
                         this.EventStudent.Prompt.enabled = false;
                         this.EventPhase++;
                         this.Timer = 0f;
                     }
                 }
                 else if (this.EventPhase == 8)
                 {
                     Animation component3 = this.EventStudent.Character.GetComponent <Animation>();
                     if (!this.Poisoned)
                     {
                         component3[this.EventStudent.BentoAnim].weight = 0f;
                         component3.CrossFade(this.EventStudent.EatAnim);
                         if (!this.EventStudent.Chopsticks[0].activeInHierarchy)
                         {
                             this.EventStudent.Chopsticks[0].SetActive(true);
                             this.EventStudent.Chopsticks[1].SetActive(true);
                         }
                     }
                     else
                     {
                         component3.CrossFade("f02_poisonDeath_00");
                         this.Timer += Time.deltaTime;
                         if (this.Timer < 13.55f)
                         {
                             if (!this.EventStudent.Chopsticks[0].activeInHierarchy)
                             {
                                 AudioClipPlayer.Play(this.EventClip[5], this.EventStudent.transform.position + Vector3.up, 5f, 10f, out this.VoiceClip);
                                 this.EventStudent.Chopsticks[0].SetActive(true);
                                 this.EventStudent.Chopsticks[1].SetActive(true);
                                 this.EventStudent.Distracted = true;
                             }
                         }
                         else if (this.Timer < 16.33333f)
                         {
                             if (this.EventStudent.Chopsticks[0].transform.parent != this.EventStudent.Bento.transform)
                             {
                                 this.EventStudent.Chopsticks[0].transform.parent = this.EventStudent.Bento.transform;
                                 this.EventStudent.Chopsticks[1].transform.parent = this.EventStudent.Bento.transform;
                             }
                             this.EventStudent.EyeShrink += Time.deltaTime;
                             if (this.EventStudent.EyeShrink > 0.9f)
                             {
                                 this.EventStudent.EyeShrink = 0.9f;
                             }
                         }
                         else if (this.EventStudent.Bento.transform.parent != null)
                         {
                             this.EventStudent.Bento.transform.parent = null;
                             this.EventStudent.Bento.GetComponent <Collider>().isTrigger = false;
                             this.EventStudent.Bento.AddComponent <Rigidbody>();
                             Rigidbody component4 = this.EventStudent.Bento.GetComponent <Rigidbody>();
                             component4.AddRelativeForce(Vector3.up * 100f);
                             component4.AddRelativeForce(Vector3.left * 100f);
                             component4.AddRelativeForce(Vector3.forward * -100f);
                         }
                         if (component3["f02_poisonDeath_00"].time > component3["f02_poisonDeath_00"].length)
                         {
                             this.EventStudent.Ragdoll.Poisoned = true;
                             this.EventStudent.BecomeRagdoll();
                             this.Yandere.Police.PoisonScene = true;
                             this.EventOver = true;
                             this.EndEvent();
                         }
                     }
                 }
                 if (this.Distance < 11f)
                 {
                     if (this.Distance < 10f)
                     {
                         float num = Mathf.Abs((this.Distance - 10f) * 0.2f);
                         if (num < 0f)
                         {
                             num = 0f;
                         }
                         if (num > 1f)
                         {
                             num = 1f;
                         }
                         this.EventSubtitle.transform.localScale = new Vector3(num, num, num);
                     }
                     else
                     {
                         this.EventSubtitle.transform.localScale = Vector3.zero;
                     }
                 }
             }
         }
     }
 }
 // Token: 0x06001298 RID: 4760 RVA: 0x0008C494 File Offset: 0x0008A694
 private void Update()
 {
     Input.GetKeyDown(KeyCode.Space);
     if (!this.Clock.StopTime && this.EventCheck && this.Clock.HourTime > this.EventTime)
     {
         this.EventStudent = this.StudentManager.Students[this.EventStudentID];
         if (this.EventStudent != null && !this.EventStudent.Distracted && this.EventStudent.MeetTime == 0f && !this.EventStudent.Meeting && !this.EventStudent.Wet)
         {
             if (!this.EventStudent.WitnessedMurder)
             {
                 this.Snacks.Prompt.Hide();
                 this.Snacks.Prompt.enabled           = false;
                 this.Snacks.enabled                  = false;
                 this.EventStudent.CurrentDestination = this.EventLocations[0];
                 this.EventStudent.Pathfinding.target = this.EventLocations[0];
                 this.EventStudent.Scrubber.SetActive(false);
                 this.EventStudent.Eraser.SetActive(false);
                 this.EventStudent.Obstacle.checkTime = 99f;
                 this.EventStudent.CookingEvent       = this;
                 this.EventStudent.InEvent            = true;
                 this.EventStudent.Private            = true;
                 this.EventStudent.Prompt.Hide();
                 this.EventCheck  = false;
                 this.EventActive = true;
                 if (this.EventStudent.Following)
                 {
                     this.EventStudent.Pathfinding.canMove = true;
                     this.EventStudent.Pathfinding.speed   = 1f;
                     this.EventStudent.Following           = false;
                     this.EventStudent.Routine             = true;
                     this.Yandere.Followers--;
                     this.EventStudent.Subtitle.UpdateLabel(SubtitleType.StopFollowApology, 0, 3f);
                     this.EventStudent.Prompt.Label[0].text = "     Talk";
                 }
             }
             else
             {
                 base.enabled = false;
             }
         }
     }
     if (this.EventActive)
     {
         if (this.Clock.HourTime > this.EventTime + 0.5f || this.EventStudent.WitnessedMurder || this.EventStudent.Splashed || this.EventStudent.Alarmed || this.EventStudent.Dying || this.EventStudent.Yandere.Cooking)
         {
             this.EndEvent();
             return;
         }
         if (this.EventStudent.DistanceToDestination < 1f)
         {
             if (this.EventPhase == -1)
             {
                 this.EventStudent.CharacterAnimation.CrossFade(this.EventAnim[0]);
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 5f)
                 {
                     SchemeGlobals.SetSchemeStage(4, 5);
                     this.Schemes.UpdateInstructions();
                     this.RivalPhone.SetActive(false);
                     this.EventSubtitle.text = string.Empty;
                     this.EventPhase++;
                     this.Timer = 0f;
                 }
             }
             else if (this.EventPhase == 0)
             {
                 if (!this.RivalPhone.activeInHierarchy)
                 {
                     this.EventStudent.CharacterAnimation.Play("f02_prepareFood_00");
                     this.EventStudent.SmartPhone.SetActive(false);
                     this.Octodog.transform.parent           = this.EventStudent.RightHand;
                     this.Octodog.transform.localPosition    = new Vector3(0.0129f, -0.02475f, 0.0316f);
                     this.Octodog.transform.localEulerAngles = new Vector3(-90f, 0f, 0f);
                     this.Sausage.transform.parent           = this.EventStudent.RightHand;
                     this.Sausage.transform.localPosition    = new Vector3(0.013f, -0.038f, 0.015f);
                     this.Sausage.transform.localEulerAngles = Vector3.zero;
                     this.EventPhase++;
                 }
                 else
                 {
                     AudioClipPlayer.Play(this.EventClip[0], this.EventStudent.transform.position + Vector3.up, 5f, 10f, out this.VoiceClip, out this.CurrentClipLength);
                     this.EventStudent.CharacterAnimation.CrossFade(this.EventAnim[0]);
                     this.EventSubtitle.text = this.EventSpeech[0];
                     this.EventPhase--;
                 }
             }
             else if (this.EventPhase == 1)
             {
                 this.EventStudent.CharacterAnimation.Play("f02_prepareFood_00");
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time > 1f)
                 {
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 2)
             {
                 this.Refrigerator.GetComponent <Animation>().Play("FridgeOpen");
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time > 3f)
                 {
                     this.Jar.transform.parent = this.EventStudent.RightHand;
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 3)
             {
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time > 5f)
                 {
                     this.JarLid.transform.parent = this.EventStudent.LeftHand;
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 4)
             {
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time > 6f)
                 {
                     this.JarLid.transform.parent           = this.CookingClub;
                     this.JarLid.transform.localPosition    = new Vector3(0.334585f, 1f, -0.2528915f);
                     this.JarLid.transform.localEulerAngles = new Vector3(0f, 30f, 0f);
                     this.Jar.transform.parent           = this.CookingClub;
                     this.Jar.transform.localPosition    = new Vector3(0.29559f, 1f, 0.2029152f);
                     this.Jar.transform.localEulerAngles = new Vector3(0f, -150f, 0f);
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 5)
             {
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time > 7f)
                 {
                     this.Knife.GetComponent <WeaponScript>().FingerprintID = this.EventStudent.StudentID;
                     this.Knife.parent           = this.EventStudent.LeftHand;
                     this.Knife.localPosition    = new Vector3(0f, -0.01f, 0f);
                     this.Knife.localEulerAngles = new Vector3(0f, 0f, -90f);
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 6)
             {
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time >= this.EventStudent.CharacterAnimation["f02_prepareFood_00"].length)
                 {
                     this.EventStudent.CharacterAnimation.CrossFade("f02_cutFood_00");
                     this.Sausage.SetActive(true);
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 7)
             {
                 if (this.EventStudent.CharacterAnimation["f02_cutFood_00"].time > 2.66666f)
                 {
                     this.Octodog.SetActive(true);
                     this.Sausage.SetActive(false);
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 8)
             {
                 if (this.EventStudent.CharacterAnimation["f02_cutFood_00"].time > 3f)
                 {
                     this.Rotation = Mathf.MoveTowards(this.Rotation, 90f, Time.deltaTime * 360f);
                     this.Octodog.transform.localEulerAngles = new Vector3(this.Rotation, this.Octodog.transform.localEulerAngles.y, this.Octodog.transform.localEulerAngles.z);
                     this.Octodog.transform.localPosition    = new Vector3(this.Octodog.transform.localPosition.x, this.Octodog.transform.localPosition.y, Mathf.MoveTowards(this.Octodog.transform.localPosition.z, 0.012f, Time.deltaTime));
                 }
                 if (this.EventStudent.CharacterAnimation["f02_cutFood_00"].time > 6f)
                 {
                     this.Octodog.SetActive(false);
                     this.Octodogs[this.Loop].gameObject.SetActive(true);
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 9)
             {
                 if (this.EventStudent.CharacterAnimation["f02_cutFood_00"].time >= this.EventStudent.CharacterAnimation["f02_cutFood_00"].length)
                 {
                     if (this.Loop < this.Octodogs.Length - 1)
                     {
                         this.Octodog.transform.localEulerAngles = new Vector3(-90f, this.Octodog.transform.localEulerAngles.y, this.Octodog.transform.localEulerAngles.z);
                         this.Octodog.transform.localPosition    = new Vector3(this.Octodog.transform.localPosition.x, this.Octodog.transform.localPosition.y, 0.0316f);
                         this.EventStudent.CharacterAnimation["f02_cutFood_00"].time = 0f;
                         this.EventStudent.CharacterAnimation.Play("f02_cutFood_00");
                         this.Sausage.SetActive(true);
                         this.EventPhase = 7;
                         this.Rotation   = -90f;
                         this.Loop++;
                     }
                     else
                     {
                         this.EventStudent.CharacterAnimation.Play("f02_prepareFood_00");
                         this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time  = this.EventStudent.CharacterAnimation["f02_prepareFood_00"].length;
                         this.EventStudent.CharacterAnimation["f02_prepareFood_00"].speed = -1f;
                         this.EventPhase++;
                     }
                 }
             }
             else if (this.EventPhase == 10)
             {
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time < this.EventStudent.CharacterAnimation["f02_prepareFood_00"].length - 1f)
                 {
                     this.Knife.parent           = this.CookingClub;
                     this.Knife.localPosition    = new Vector3(0.197f, 1.1903f, -0.33333f);
                     this.Knife.localEulerAngles = new Vector3(45f, -90f, -90f);
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 11)
             {
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time < this.EventStudent.CharacterAnimation["f02_prepareFood_00"].length - 2f)
                 {
                     this.JarLid.parent = this.EventStudent.LeftHand;
                     this.Jar.parent    = this.EventStudent.RightHand;
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 12)
             {
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time < this.EventStudent.CharacterAnimation["f02_prepareFood_00"].length - 3f)
                 {
                     this.JarLid.parent           = this.Jar;
                     this.JarLid.localPosition    = new Vector3(0f, 0.175f, 0f);
                     this.JarLid.localEulerAngles = Vector3.zero;
                     this.Refrigerator.GetComponent <Animation>().Play("FridgeOpen");
                     this.Refrigerator.GetComponent <Animation>()["FridgeOpen"].time  = this.Refrigerator.GetComponent <Animation>()["FridgeOpen"].length;
                     this.Refrigerator.GetComponent <Animation>()["FridgeOpen"].speed = -1f;
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 13)
             {
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time < this.EventStudent.CharacterAnimation["f02_prepareFood_00"].length - 5f)
                 {
                     this.Jar.parent           = this.CookingClub;
                     this.Jar.localPosition    = new Vector3(0.1f, 0.941f, 0.75f);
                     this.Jar.localEulerAngles = new Vector3(0f, 90f, 0f);
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 14)
             {
                 if (this.EventStudent.CharacterAnimation["f02_prepareFood_00"].time <= 0f)
                 {
                     this.Knife.GetComponent <Collider>().enabled = true;
                     this.Plate.parent                    = this.EventStudent.RightHand;
                     this.Plate.localPosition             = new Vector3(0f, 0.011f, -0.156765f);
                     this.Plate.localEulerAngles          = new Vector3(0f, -90f, -180f);
                     this.EventStudent.CurrentDestination = this.EventLocations[1];
                     this.EventStudent.Pathfinding.target = this.EventLocations[1];
                     this.EventStudent.CharacterAnimation[this.EventStudent.CarryAnim].weight = 1f;
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 15)
             {
                 this.Plate.parent           = this.CookingClub;
                 this.Plate.localPosition    = new Vector3(-3.66666f, 0.9066666f, -2.379f);
                 this.Plate.localEulerAngles = new Vector3(0f, -90f, 0f);
                 this.EndEvent();
             }
             float num = Vector3.Distance(this.Yandere.transform.position, this.EventStudent.transform.position);
             if (num < 10f)
             {
                 float num2 = Mathf.Abs((num - 10f) * 0.2f);
                 if (num2 < 0f)
                 {
                     num2 = 0f;
                 }
                 if (num2 > 1f)
                 {
                     num2 = 1f;
                 }
                 this.EventSubtitle.transform.localScale = new Vector3(num2, num2, num2);
                 return;
             }
             this.EventSubtitle.transform.localScale = Vector3.zero;
         }
     }
 }
 // Token: 0x060019A7 RID: 6567 RVA: 0x000FAA20 File Offset: 0x000F8C20
 private void Update()
 {
     if (!this.Clock.StopTime && !this.EventActive && this.Clock.HourTime > this.EventTime)
     {
         this.EventStudent = this.StudentManager.Students[2];
         if (this.EventStudent != null && !this.EventStudent.Distracted && !this.EventStudent.Talking)
         {
             if (!this.EventStudent.WitnessedMurder && !this.EventStudent.Bullied)
             {
                 if (this.EventStudent.Cosmetic.FemaleAccessories[3].activeInHierarchy)
                 {
                     if (SchemeGlobals.GetSchemeStage(2) < 100)
                     {
                         this.RingPrompt       = this.EventStudent.Cosmetic.FemaleAccessories[3].GetComponent <PromptScript>();
                         this.RingCollider     = this.EventStudent.Cosmetic.FemaleAccessories[3].GetComponent <BoxCollider>();
                         this.OriginalPosition = this.EventStudent.Cosmetic.FemaleAccessories[3].transform.localPosition;
                         this.EventStudent.CurrentDestination = this.EventStudent.Destinations[this.EventStudent.Phase];
                         this.EventStudent.Pathfinding.target = this.EventStudent.Destinations[this.EventStudent.Phase];
                         this.EventStudent.Obstacle.checkTime = 99f;
                         this.EventStudent.InEvent            = true;
                         this.EventStudent.Private            = true;
                         this.EventStudent.Prompt.Hide();
                         this.EventActive = true;
                         if (this.EventStudent.Following)
                         {
                             this.EventStudent.Pathfinding.canMove = true;
                             this.EventStudent.Pathfinding.speed   = 1f;
                             this.EventStudent.Following           = false;
                             this.EventStudent.Routine             = true;
                             this.Yandere.Followers--;
                             this.EventStudent.Subtitle.UpdateLabel(SubtitleType.StopFollowApology, 0, 3f);
                             this.EventStudent.Prompt.Label[0].text = "     Talk";
                         }
                     }
                     else
                     {
                         base.enabled = false;
                     }
                 }
                 else
                 {
                     base.enabled = false;
                 }
             }
             else
             {
                 base.enabled = false;
             }
         }
     }
     if (this.EventActive)
     {
         if (this.EventStudent.DistanceToDestination < 0.5f)
         {
             this.EventStudent.Pathfinding.canSearch = false;
             this.EventStudent.Pathfinding.canMove   = false;
         }
         if (this.EventStudent.Alarmed && this.Yandere.TheftTimer > 0f)
         {
             Debug.Log("Event ended because Sakyu saw theft.");
             this.EventStudent.Cosmetic.FemaleAccessories[3].transform.parent           = this.EventStudent.LeftMiddleFinger;
             this.EventStudent.Cosmetic.FemaleAccessories[3].transform.localPosition    = this.OriginalPosition;
             this.EventStudent.Cosmetic.FemaleAccessories[3].transform.localEulerAngles = new Vector3(0f, 0f, 0f);
             this.RingCollider.gameObject.SetActive(true);
             this.RingCollider.enabled   = false;
             this.Yandere.Inventory.Ring = false;
             this.EndEvent();
             return;
         }
         if (this.Clock.HourTime > this.EventTime + 0.5f || this.EventStudent.WitnessedMurder || this.EventStudent.Splashed || this.EventStudent.Alarmed || this.EventStudent.Dying || !this.EventStudent.Alive)
         {
             this.EndEvent();
             return;
         }
         if (!this.EventStudent.Pathfinding.canMove)
         {
             if (this.EventPhase == 1)
             {
                 this.Timer += Time.deltaTime;
                 this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventAnim[0]);
                 this.EventPhase++;
             }
             else if (this.EventPhase == 2)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[0]].length)
                 {
                     this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventStudent.EatAnim);
                     this.EventStudent.Bento.transform.localPosition    = new Vector3(-0.025f, -0.105f, 0f);
                     this.EventStudent.Bento.transform.localEulerAngles = new Vector3(0f, 165f, 82.5f);
                     this.EventStudent.Chopsticks[0].SetActive(true);
                     this.EventStudent.Chopsticks[1].SetActive(true);
                     this.EventStudent.Bento.SetActive(true);
                     this.EventStudent.Lid.SetActive(false);
                     this.RingCollider.enabled = true;
                     this.EventPhase++;
                     this.Timer = 0f;
                 }
                 else if (this.Timer > 4f)
                 {
                     if (this.EventStudent.Cosmetic.FemaleAccessories[3] != null)
                     {
                         this.EventStudent.Cosmetic.FemaleAccessories[3].transform.parent      = null;
                         this.EventStudent.Cosmetic.FemaleAccessories[3].transform.position    = new Vector3(-2.707666f, 12.4695f, -31.136f);
                         this.EventStudent.Cosmetic.FemaleAccessories[3].transform.eulerAngles = new Vector3(-20f, 180f, 0f);
                     }
                 }
                 else if (this.Timer > 2.5f)
                 {
                     this.EventStudent.Cosmetic.FemaleAccessories[3].transform.parent           = this.EventStudent.RightHand;
                     this.EventStudent.Cosmetic.FemaleAccessories[3].transform.localPosition    = this.HoldingPosition;
                     this.EventStudent.Cosmetic.FemaleAccessories[3].transform.localEulerAngles = this.HoldingRotation;
                 }
             }
             else if (this.EventPhase == 3)
             {
                 if (this.Clock.HourTime > 13.375f)
                 {
                     this.EventStudent.Bento.SetActive(false);
                     this.EventStudent.Chopsticks[0].SetActive(false);
                     this.EventStudent.Chopsticks[1].SetActive(false);
                     if (this.RingCollider != null)
                     {
                         this.RingCollider.enabled = false;
                     }
                     if (this.RingPrompt != null)
                     {
                         this.RingPrompt.Hide();
                         this.RingPrompt.enabled = false;
                     }
                     this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[0]].time  = this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[0]].length;
                     this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[0]].speed = -1f;
                     this.EventStudent.Character.GetComponent <Animation>().CrossFade((this.EventStudent.Cosmetic.FemaleAccessories[3] != null) ? this.EventAnim[0] : this.EventAnim[1]);
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 4)
             {
                 this.Timer += Time.deltaTime;
                 if (this.EventStudent.Cosmetic.FemaleAccessories[3] != null)
                 {
                     if (this.Timer > 2f)
                     {
                         this.EventStudent.Cosmetic.FemaleAccessories[3].transform.parent           = this.EventStudent.RightHand;
                         this.EventStudent.Cosmetic.FemaleAccessories[3].transform.localPosition    = this.HoldingPosition;
                         this.EventStudent.Cosmetic.FemaleAccessories[3].transform.localEulerAngles = this.HoldingRotation;
                     }
                     if (this.Timer > 3f)
                     {
                         this.EventStudent.Cosmetic.FemaleAccessories[3].transform.parent        = this.EventStudent.LeftMiddleFinger;
                         this.EventStudent.Cosmetic.FemaleAccessories[3].transform.localPosition = this.OriginalPosition;
                         this.RingCollider.enabled = false;
                     }
                     if (this.Timer > 6f)
                     {
                         this.EndEvent();
                     }
                 }
                 else if (this.Timer > 1.5f && this.Yandere.transform.position.z < 0f)
                 {
                     this.EventSubtitle.text = this.EventSpeech[0];
                     AudioClipPlayer.Play(this.EventClip[0], this.EventStudent.transform.position + Vector3.up, 5f, 10f, out this.VoiceClip, out this.CurrentClipLength);
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 5)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 9.5f)
                 {
                     this.EndEvent();
                 }
             }
             float num = Vector3.Distance(this.Yandere.transform.position, this.EventStudent.transform.position);
             if (num < 11f)
             {
                 if (num < 10f)
                 {
                     float num2 = Mathf.Abs((num - 10f) * 0.2f);
                     if (num2 < 0f)
                     {
                         num2 = 0f;
                     }
                     if (num2 > 1f)
                     {
                         num2 = 1f;
                     }
                     this.EventSubtitle.transform.localScale = new Vector3(num2, num2, num2);
                     return;
                 }
                 this.EventSubtitle.transform.localScale = Vector3.zero;
             }
         }
     }
 }
Beispiel #17
0
 // Token: 0x06000638 RID: 1592 RVA: 0x00058E34 File Offset: 0x00057234
 private void Update()
 {
     if (!this.Clock.StopTime && this.EventCheck)
     {
         if (this.Clock.HourTime > this.EventTime + 0.5f)
         {
             base.enabled = false;
         }
         else if (this.Clock.HourTime > this.EventTime)
         {
             this.EventStudent = this.StudentManager.Students[this.EventStudentID];
             if (this.EventStudent != null && this.EventStudent.Routine && !this.EventStudent.Distracted && !this.EventStudent.Talking && !this.EventStudent.Meeting && this.EventStudent.Indoors)
             {
                 if (!this.EventStudent.WitnessedMurder)
                 {
                     this.EventStudent.CurrentDestination = this.EventStudent.Destinations[this.EventStudent.Phase];
                     this.EventStudent.Pathfinding.target = this.EventStudent.Destinations[this.EventStudent.Phase];
                     this.EventStudent.Obstacle.checkTime = 99f;
                     this.EventStudent.SpeechLines.Stop();
                     this.EventStudent.PhoneEvent = this;
                     this.EventStudent.CanTalk    = false;
                     this.EventStudent.InEvent    = true;
                     this.EventStudent.Private    = true;
                     this.EventStudent.Prompt.Hide();
                     this.EventCheck  = false;
                     this.EventActive = true;
                     if (this.EventStudent.Following)
                     {
                         this.EventStudent.Pathfinding.canMove = true;
                         this.EventStudent.Pathfinding.speed   = 1f;
                         this.EventStudent.Following           = false;
                         this.EventStudent.Routine             = true;
                         this.Yandere.Followers--;
                         this.EventStudent.Subtitle.UpdateLabel(SubtitleType.StopFollowApology, 0, 3f);
                         this.EventStudent.Prompt.Label[0].text = "     Talk";
                     }
                 }
                 else
                 {
                     base.enabled = false;
                 }
             }
         }
     }
     if (this.EventActive)
     {
         if (this.EventStudent.DistanceToDestination < 0.5f)
         {
             this.EventStudent.Pathfinding.canSearch = false;
             this.EventStudent.Pathfinding.canMove   = false;
         }
         if (this.Clock.HourTime > this.EventTime + 0.5f || this.EventStudent.WitnessedMurder || this.EventStudent.Splashed || this.EventStudent.Alarmed || this.EventStudent.Dying || !this.EventStudent.Alive)
         {
             this.EndEvent();
         }
         else if (!this.EventStudent.Pathfinding.canMove)
         {
             if (this.EventPhase == 1)
             {
                 this.Timer += Time.deltaTime;
                 this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventAnim[0]);
                 AudioClipPlayer.Play(this.EventClip[0], this.EventStudent.transform.position, 5f, 10f, out this.VoiceClip, out this.CurrentClipLength);
                 this.EventPhase++;
             }
             else if (this.EventPhase == 2)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > 1.5f)
                 {
                     if (this.EventStudent.StudentID == 33)
                     {
                         this.EventStudent.SmartPhone.SetActive(true);
                     }
                     else
                     {
                         this.EventStudent.Phone.SetActive(true);
                     }
                 }
                 if (this.Timer > 3f)
                 {
                     AudioClipPlayer.Play(this.EventClip[1], this.EventStudent.transform.position, 5f, 10f, out this.VoiceClip, out this.CurrentClipLength);
                     this.EventSubtitle.text = this.EventSpeech[1];
                     this.Timer = 0f;
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 3)
             {
                 this.Timer += Time.deltaTime;
                 if (this.Timer > this.CurrentClipLength)
                 {
                     this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventStudent.RunAnim);
                     this.EventStudent.CurrentDestination    = this.EventLocation;
                     this.EventStudent.Pathfinding.target    = this.EventLocation;
                     this.EventStudent.Pathfinding.canSearch = true;
                     this.EventStudent.Pathfinding.canMove   = true;
                     this.EventStudent.Pathfinding.speed     = 4f;
                     this.EventSubtitle.text = string.Empty;
                     this.Timer = 0f;
                     this.EventPhase++;
                 }
             }
             else if (this.EventPhase == 4)
             {
                 this.DumpPoint.enabled = true;
                 this.EventStudent.Character.GetComponent <Animation>().CrossFade(this.EventAnim[2]);
                 AudioClipPlayer.Play(this.EventClip[2], this.EventStudent.transform.position, 5f, 10f, out this.VoiceClip, out this.CurrentClipLength);
                 this.EventPhase++;
             }
             else if (this.EventPhase < 13)
             {
                 if (this.VoiceClip != null)
                 {
                     this.VoiceClip.GetComponent <AudioSource>().pitch = Time.timeScale;
                     this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[2]].time = this.VoiceClip.GetComponent <AudioSource>().time;
                     if (this.VoiceClip.GetComponent <AudioSource>().time > this.SpeechTimes[this.EventPhase - 3])
                     {
                         this.EventSubtitle.text = this.EventSpeech[this.EventPhase - 3];
                         this.EventPhase++;
                     }
                 }
             }
             else
             {
                 if (this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[2]].time >= this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[2]].length * 90.33333f)
                 {
                     if (this.EventStudent.StudentID == 33)
                     {
                         this.EventStudent.SmartPhone.SetActive(true);
                     }
                     else
                     {
                         this.EventStudent.Phone.SetActive(true);
                     }
                 }
                 if (this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[2]].time >= this.EventStudent.Character.GetComponent <Animation>()[this.EventAnim[2]].length)
                 {
                     this.EndEvent();
                 }
             }
             float num = Vector3.Distance(this.Yandere.transform.position, this.EventStudent.transform.position);
             if (num < 10f)
             {
                 float num2 = Mathf.Abs((num - 10f) * 0.2f);
                 if (num2 < 0f)
                 {
                     num2 = 0f;
                 }
                 if (num2 > 1f)
                 {
                     num2 = 1f;
                 }
                 this.EventSubtitle.transform.localScale = new Vector3(num2, num2, num2);
             }
             else
             {
                 this.EventSubtitle.transform.localScale = Vector3.zero;
             }
             if (this.EventPhase == 11 && num < 5f && !EventGlobals.Event2)
             {
                 EventGlobals.Event2 = true;
                 this.Yandere.NotificationManager.DisplayNotification(NotificationType.Info);
                 ConversationGlobals.SetTopicDiscovered(25, true);
                 this.Yandere.NotificationManager.DisplayNotification(NotificationType.Topic);
                 this.Yandere.NotificationManager.DisplayNotification(NotificationType.Opinion);
                 ConversationGlobals.SetTopicLearnedByStudent(25, this.EventStudentID, true);
             }
         }
     }
 }