Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. public static int x=1;
  2. Image image;
  3. // Use this for initialization
  4. void Start () {
  5.  
  6. image = GameObject.Find ("box1").GetComponent<Image> ();
  7.  
  8. }
  9.  
  10. // Update is called once per frame
  11. void Update () {
  12.  
  13. }
  14.  
  15. void OnMouseDown()
  16. {
  17. if (x == 1) {
  18. x=2;
  19. image.sprite = greenbox;
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement