Advertisement
Guest User

Untitled

a guest
May 6th, 2020
1,462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.45 KB | None | 0 0
  1. Make a new script and put this
  2. using System;
  3. using UnityEngine;
  4.  
  5. // Token: 0x020000A5 RID: 165
  6. public class ChalklesScript : MonoBehaviour
  7. {
  8. // Token: 0x0600024E RID: 590 RVA: 0x00011C70 File Offset: 0x0000FE70
  9. private void Start()
  10. {
  11. base.transform.position = (base.transform.position - this.Thing.position).normalized * this.radius + this.Thing.position;
  12. this.axis = Vector3.up;
  13. }
  14.  
  15. // Token: 0x0600024F RID: 591 RVA: 0x00011CD4 File Offset: 0x0000FED4
  16. private void Update()
  17. {
  18. if (Time.deltaTime != 0f)
  19. {
  20. this.Timer += 1f * Time.deltaTime;
  21. base.transform.RotateAround(this.Thing.position, this.axis, this.rotationSpeed * Time.deltaTime);
  22. Vector3 target = (base.transform.position - this.Thing.position).normalized * this.radius + this.Thing.position;
  23. base.transform.position = Vector3.MoveTowards(base.transform.position, target, Time.deltaTime * this.radiusSpeed);
  24. base.transform.position = new Vector3(base.transform.position.x, base.transform.position.y + this.Timer * 0.005f, base.transform.position.z);
  25. this.rotationSpeed += this.Timer * 0.01f;
  26. this.radiusSpeed += this.Timer * 0.01f;
  27. this.radius -= this.Timer * 0.0008f;
  28. }
  29. if (this.trigger.Chalkles.transform.position.y > 11f)
  30. {
  31. this.trigger.Freedom();
  32. }
  33. }
  34.  
  35. // Token: 0x0400035A RID: 858
  36. public Transform Thing;
  37.  
  38. // Token: 0x0400035B RID: 859
  39. public float Timer;
  40.  
  41. // Token: 0x0400035C RID: 860
  42. public ChalklesTriggerScript trigger;
  43.  
  44. // Token: 0x0400035D RID: 861
  45. public float radius;
  46.  
  47. // Token: 0x0400035E RID: 862
  48. public Vector3 axis;
  49.  
  50. // Token: 0x0400035F RID: 863
  51. public float rotationSpeed;
  52.  
  53. // Token: 0x04000360 RID: 864
  54. public float radiusSpeed;
  55. }
  56.  
  57. then another script
  58.  
  59. using System;
  60. using UnityEngine;
  61.  
  62. // Token: 0x020000A6 RID: 166
  63. public class ChalklesTriggerScript : MonoBehaviour
  64. {
  65. // Token: 0x06000251 RID: 593 RVA: 0x00002C37 File Offset: 0x00000E37
  66. private void Start()
  67. {
  68. }
  69.  
  70. // Token: 0x06000252 RID: 594 RVA: 0x00011E6C File Offset: 0x0001006C
  71. private void Update()
  72. {
  73. if (Time.timeScale != 0f)
  74. {
  75. if (this.Paused)
  76. {
  77. this.Audio.UnPause();
  78. this.Paused = false;
  79. }
  80. }
  81. else if (!this.Paused)
  82. {
  83. this.Audio.Pause();
  84. this.Paused = true;
  85. }
  86. if (this.Audio.isPlaying)
  87. {
  88. this.spawnTime += Time.deltaTime + (this.FakeChalkles.transform.position - this.player.position).magnitude * 1E-05f;
  89. this.draw.color = new Color(255f, 255f, 255f, 0.2f + this.spawnTime * 0.05f);
  90. this.Audio.pitch = 1f + this.spawnTime * 0.1f;
  91. }
  92. else
  93. {
  94. if (this.spawnTime > 0f)
  95. {
  96. this.spawnTime -= Time.deltaTime + (this.FakeChalkles.transform.position - this.player.position).magnitude * 1E-05f;
  97. this.draw.color = new Color(255f, 255f, 255f, 0.2f + this.spawnTime * 0.05f);
  98. }
  99. if (this.PlayerIsNear & !this.Paused & !this.Alive)
  100. {
  101. this.FakeChalkles.SetActive(false);
  102. this.Chalkles.SetActive(true);
  103. this.door.LockDoor(40f);
  104. if (PlayerPrefs.GetFloat("cha") == 0f)
  105. {
  106. PlayerPrefs.SetFloat("cha", 1f);
  107. }
  108. this.Alive = true;
  109. if (this.Baldi.isActiveAndEnabled)
  110. {
  111. this.Baldi.Hear(this.Chalkles.transform.position, 5f);
  112. }
  113. }
  114. }
  115. }
  116.  
  117. // Token: 0x06000253 RID: 595 RVA: 0x00003944 File Offset: 0x00001B44
  118. private void OnTriggerEnter(Collider other)
  119. {
  120. if (other.tag == "Player")
  121. {
  122. this.Audio.Play();
  123. this.PlayerIsNear = true;
  124. }
  125. }
  126.  
  127. // Token: 0x06000254 RID: 596 RVA: 0x0000396D File Offset: 0x00001B6D
  128. private void OnTriggerExit(Collider other)
  129. {
  130. if (other.tag == "Player")
  131. {
  132. this.Audio.Stop();
  133. this.PlayerIsNear = false;
  134. }
  135. }
  136.  
  137. // Token: 0x06000255 RID: 597 RVA: 0x00003996 File Offset: 0x00001B96
  138. public void Freedom()
  139. {
  140. this.Chalkles.SetActive(false);
  141. this.door.UnlockDoor();
  142. }
  143.  
  144. // Token: 0x04000361 RID: 865
  145. public float spawnTime;
  146.  
  147. // Token: 0x04000362 RID: 866
  148. public bool PlayerIsNear;
  149.  
  150. // Token: 0x04000363 RID: 867
  151. public bool Paused;
  152.  
  153. // Token: 0x04000364 RID: 868
  154. public GameObject Chalkles;
  155.  
  156. // Token: 0x04000365 RID: 869
  157. public GameObject FakeChalkles;
  158.  
  159. // Token: 0x04000366 RID: 870
  160. public AudioSource Audio;
  161.  
  162. // Token: 0x04000367 RID: 871
  163. public SpriteRenderer draw;
  164.  
  165. // Token: 0x04000368 RID: 872
  166. public DoorScript door;
  167.  
  168. // Token: 0x04000369 RID: 873
  169. public BaldiScript Baldi;
  170.  
  171. // Token: 0x0400036A RID: 874
  172. public Transform player;
  173.  
  174. // Token: 0x0400036C RID: 876
  175. public bool Alive;
  176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement