duck

Untitled

Feb 11th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class GuiTextButton : MonoBehaviour {
  5.  
  6. public Texture2D normal;
  7. public Texture2D over;
  8.  
  9. public GameObject machine;
  10. public Unit unit;
  11.  
  12.  
  13. void OnMouseEnter(){
  14.  
  15. guiTexture.texture = over;
  16.  
  17. if(Input.GetMouseButtonUp(0)){
  18.  
  19. unit.SetMachine(machine);
  20. }
  21. }
  22.  
  23.  
  24.  
  25. void OnMouseExit(){
  26.  
  27. guiTexture.texture = normal;
  28.  
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment