Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Make a new script and put this
- using System;
- using UnityEngine;
- // Token: 0x020000A5 RID: 165
- public class ChalklesScript : MonoBehaviour
- {
- // Token: 0x0600024E RID: 590 RVA: 0x00011C70 File Offset: 0x0000FE70
- private void Start()
- {
- base.transform.position = (base.transform.position - this.Thing.position).normalized * this.radius + this.Thing.position;
- this.axis = Vector3.up;
- }
- // Token: 0x0600024F RID: 591 RVA: 0x00011CD4 File Offset: 0x0000FED4
- private void Update()
- {
- if (Time.deltaTime != 0f)
- {
- this.Timer += 1f * Time.deltaTime;
- base.transform.RotateAround(this.Thing.position, this.axis, this.rotationSpeed * Time.deltaTime);
- Vector3 target = (base.transform.position - this.Thing.position).normalized * this.radius + this.Thing.position;
- base.transform.position = Vector3.MoveTowards(base.transform.position, target, Time.deltaTime * this.radiusSpeed);
- base.transform.position = new Vector3(base.transform.position.x, base.transform.position.y + this.Timer * 0.005f, base.transform.position.z);
- this.rotationSpeed += this.Timer * 0.01f;
- this.radiusSpeed += this.Timer * 0.01f;
- this.radius -= this.Timer * 0.0008f;
- }
- if (this.trigger.Chalkles.transform.position.y > 11f)
- {
- this.trigger.Freedom();
- }
- }
- // Token: 0x0400035A RID: 858
- public Transform Thing;
- // Token: 0x0400035B RID: 859
- public float Timer;
- // Token: 0x0400035C RID: 860
- public ChalklesTriggerScript trigger;
- // Token: 0x0400035D RID: 861
- public float radius;
- // Token: 0x0400035E RID: 862
- public Vector3 axis;
- // Token: 0x0400035F RID: 863
- public float rotationSpeed;
- // Token: 0x04000360 RID: 864
- public float radiusSpeed;
- }
- then another script
- using System;
- using UnityEngine;
- // Token: 0x020000A6 RID: 166
- public class ChalklesTriggerScript : MonoBehaviour
- {
- // Token: 0x06000251 RID: 593 RVA: 0x00002C37 File Offset: 0x00000E37
- private void Start()
- {
- }
- // Token: 0x06000252 RID: 594 RVA: 0x00011E6C File Offset: 0x0001006C
- private void Update()
- {
- if (Time.timeScale != 0f)
- {
- if (this.Paused)
- {
- this.Audio.UnPause();
- this.Paused = false;
- }
- }
- else if (!this.Paused)
- {
- this.Audio.Pause();
- this.Paused = true;
- }
- if (this.Audio.isPlaying)
- {
- this.spawnTime += Time.deltaTime + (this.FakeChalkles.transform.position - this.player.position).magnitude * 1E-05f;
- this.draw.color = new Color(255f, 255f, 255f, 0.2f + this.spawnTime * 0.05f);
- this.Audio.pitch = 1f + this.spawnTime * 0.1f;
- }
- else
- {
- if (this.spawnTime > 0f)
- {
- this.spawnTime -= Time.deltaTime + (this.FakeChalkles.transform.position - this.player.position).magnitude * 1E-05f;
- this.draw.color = new Color(255f, 255f, 255f, 0.2f + this.spawnTime * 0.05f);
- }
- if (this.PlayerIsNear & !this.Paused & !this.Alive)
- {
- this.FakeChalkles.SetActive(false);
- this.Chalkles.SetActive(true);
- this.door.LockDoor(40f);
- if (PlayerPrefs.GetFloat("cha") == 0f)
- {
- PlayerPrefs.SetFloat("cha", 1f);
- }
- this.Alive = true;
- if (this.Baldi.isActiveAndEnabled)
- {
- this.Baldi.Hear(this.Chalkles.transform.position, 5f);
- }
- }
- }
- }
- // Token: 0x06000253 RID: 595 RVA: 0x00003944 File Offset: 0x00001B44
- private void OnTriggerEnter(Collider other)
- {
- if (other.tag == "Player")
- {
- this.Audio.Play();
- this.PlayerIsNear = true;
- }
- }
- // Token: 0x06000254 RID: 596 RVA: 0x0000396D File Offset: 0x00001B6D
- private void OnTriggerExit(Collider other)
- {
- if (other.tag == "Player")
- {
- this.Audio.Stop();
- this.PlayerIsNear = false;
- }
- }
- // Token: 0x06000255 RID: 597 RVA: 0x00003996 File Offset: 0x00001B96
- public void Freedom()
- {
- this.Chalkles.SetActive(false);
- this.door.UnlockDoor();
- }
- // Token: 0x04000361 RID: 865
- public float spawnTime;
- // Token: 0x04000362 RID: 866
- public bool PlayerIsNear;
- // Token: 0x04000363 RID: 867
- public bool Paused;
- // Token: 0x04000364 RID: 868
- public GameObject Chalkles;
- // Token: 0x04000365 RID: 869
- public GameObject FakeChalkles;
- // Token: 0x04000366 RID: 870
- public AudioSource Audio;
- // Token: 0x04000367 RID: 871
- public SpriteRenderer draw;
- // Token: 0x04000368 RID: 872
- public DoorScript door;
- // Token: 0x04000369 RID: 873
- public BaldiScript Baldi;
- // Token: 0x0400036A RID: 874
- public Transform player;
- // Token: 0x0400036C RID: 876
- public bool Alive;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement