Advertisement
Guest User

ыыы

a guest
Sep 2nd, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Pause : MonoBehaviour
  5. {
  6. public UIButton next;
  7. public UIButton restart;
  8. public UIButton pause;
  9. public GameObject camera;
  10.  
  11. [HideInInspector]
  12. public Blur blur;
  13. [HideInInspector]
  14. public GrayscaleEffect ge;
  15.  
  16. void Start()
  17. {
  18. next.gameObject.SetActive(false);
  19. restart.gameObject.SetActive(false);
  20. blur = camera.gameObject.GetComponent<Blur>();
  21. ge = camera.gameObject.GetComponent<GrayscaleEffect>();
  22.  
  23. blur.enabled = false;
  24. ge.enabled = false;
  25. }
  26.  
  27. void Update()
  28. {
  29. if(Time.timeScale == 0)
  30. {
  31. next.gameObject.SetActive(true);
  32. restart.gameObject.SetActive(true);
  33. pause.gameObject.SetActive(false);
  34.  
  35. blur.enabled = true;
  36. ge.enabled = true;
  37. }
  38. else
  39. {
  40. pause.gameObject.SetActive(true);
  41. next.gameObject.SetActive(false);
  42. restart.gameObject.SetActive(false);
  43.  
  44. blur.enabled = false;
  45. ge.enabled = false;
  46. }
  47.  
  48. }
  49. void OnPause()
  50. {
  51. Time.timeScale = 0;
  52. }
  53.  
  54. void OffPause()
  55. {
  56. Time.timeScale = 1;
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement