Example #1
0
 // Token: 0x060006CB RID: 1739 RVA: 0x000677E8 File Offset: 0x00065BE8
 private void Update()
 {
     if (base.transform.parent == null)
     {
         if (this.CooldownTimer > 0f)
         {
             this.CooldownTimer = Mathf.MoveTowards(this.CooldownTimer, 0f, Time.deltaTime);
             if (this.CooldownTimer == 0f)
             {
                 this.Prompt.enabled = true;
             }
         }
         else
         {
             UISprite uisprite = this.Prompt.Circle[0];
             if (uisprite.fillAmount == 0f)
             {
                 uisprite.fillAmount = 1f;
                 if (!this.On)
                 {
                     this.Prompt.Label[0].text            = "     Turn Off";
                     this.MyRenderer.material.mainTexture = this.OnTexture;
                     base.GetComponent <AudioSource>().Play();
                     this.On = true;
                 }
                 else
                 {
                     this.CooldownTimer = 1f;
                     this.TurnOff();
                 }
             }
         }
         if (this.On && this.Victim == null)
         {
             GameObject      gameObject = UnityEngine.Object.Instantiate <GameObject>(this.AlarmDisc, base.transform.position + Vector3.up, Quaternion.identity);
             AlarmDiscScript component  = gameObject.GetComponent <AlarmDiscScript>();
             component.SourceRadio = this;
             component.NoScream    = true;
             component.Radio       = true;
         }
     }
     else if (this.Prompt.enabled)
     {
         this.Prompt.enabled = false;
         this.Prompt.Hide();
     }
 }
 // Token: 0x06001970 RID: 6512 RVA: 0x000F61A0 File Offset: 0x000F43A0
 private void Update()
 {
     if (base.transform.parent == null)
     {
         if (this.CooldownTimer > 0f)
         {
             this.CooldownTimer = Mathf.MoveTowards(this.CooldownTimer, 0f, Time.deltaTime);
             if (this.CooldownTimer == 0f)
             {
                 this.Prompt.enabled = true;
             }
         }
         else
         {
             UISprite uisprite = this.Prompt.Circle[0];
             if (uisprite.fillAmount == 0f)
             {
                 uisprite.fillAmount = 1f;
                 if (!this.On)
                 {
                     this.Prompt.Label[0].text            = "     Turn Off";
                     this.MyRenderer.material.mainTexture = this.OnTexture;
                     base.GetComponent <AudioSource>().Play();
                     this.RadioNotes.SetActive(true);
                     this.On = true;
                 }
                 else
                 {
                     this.CooldownTimer = 1f;
                     this.TurnOff();
                 }
             }
         }
         if (this.On && this.Victim == null && this.AlarmDisc != null)
         {
             AlarmDiscScript component = UnityEngine.Object.Instantiate <GameObject>(this.AlarmDisc, base.transform.position + Vector3.up, Quaternion.identity).GetComponent <AlarmDiscScript>();
             component.SourceRadio = this;
             component.NoScream    = true;
             component.Radio       = true;
         }
     }
     else if (this.Prompt.enabled)
     {
         this.Prompt.enabled = false;
         this.Prompt.Hide();
     }
     if (this.Delinquent)
     {
         this.Proximity = 0;
         this.ID        = 1;
         while (this.ID < 6)
         {
             if (this.StudentManager.Students[75 + this.ID] != null && Vector3.Distance(base.transform.position, this.StudentManager.Students[75 + this.ID].transform.position) < 1.1f)
             {
                 if (!this.StudentManager.Students[75 + this.ID].Alarmed && !this.StudentManager.Students[75 + this.ID].Threatened && this.StudentManager.Students[75 + this.ID].Alive)
                 {
                     this.Proximity++;
                 }
                 else
                 {
                     this.Proximity = -100;
                     this.ID        = 5;
                     this.MyAudio.Stop();
                     this.Jukebox.ClubDip = 0f;
                 }
             }
             this.ID++;
         }
         if (this.Proximity > 0)
         {
             if (!base.GetComponent <AudioSource>().isPlaying)
             {
                 base.GetComponent <AudioSource>().Play();
             }
             float num = Vector3.Distance(this.Prompt.Yandere.transform.position, base.transform.position);
             if (num < 11f)
             {
                 this.Jukebox.ClubDip = Mathf.MoveTowards(this.Jukebox.ClubDip, (10f - num) * 0.2f * this.Jukebox.Volume, Time.deltaTime);
                 if (this.Jukebox.ClubDip < 0f)
                 {
                     this.Jukebox.ClubDip = 0f;
                 }
                 if (this.Jukebox.ClubDip > this.Jukebox.Volume)
                 {
                     this.Jukebox.ClubDip = this.Jukebox.Volume;
                     return;
                 }
             }
         }
         else if (this.MyAudio.isPlaying)
         {
             this.MyAudio.Stop();
             this.Jukebox.ClubDip = 0f;
         }
     }
 }