Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class PlayPauseButtonSprite : MonoBehaviour
  7. {
  8. PlayPauseButton RefScript;
  9.  
  10. Image playImage;
  11.  
  12. public Sprite playSprite;
  13. public Sprite pauseSprite;
  14.  
  15. void Start()
  16. {
  17. playImage = GetComponent<Image>();
  18. RefScript = GetComponent<PlayPauseButton>();
  19. }
  20.  
  21. public void Update()
  22. {
  23. if (RefScript.play == false)
  24. // if (Input.GetKey(KeyCode.Space))
  25. {
  26. //Debug.Log(RefScript.play);
  27. playImage.sprite = playSprite;
  28. // RefScript.play = true;
  29. }
  30. if (RefScript.play == true)
  31. {
  32.  
  33. playImage.sprite = pauseSprite;
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement