SHOW:
|
|
- or go back to the newest paste.
| 1 | using UnityEngine; | |
| 2 | using System.Collections; | |
| 3 | ||
| 4 | public class GuiTextButton : MonoBehaviour {
| |
| 5 | ||
| 6 | public Texture2D normal; | |
| 7 | public Texture2D over; | |
| 8 | public Unit unit; | |
| 9 | public GameObject machine; | |
| 10 | ||
| 11 | ||
| 12 | void OnMouseEnter(){
| |
| 13 | ||
| 14 | guiTexture.texture = over; | |
| 15 | ||
| 16 | if(Input.GetMouseButtonUp(0)){
| |
| 17 | ||
| 18 | - | Unit.SendMessage("SetMachine", machine);
|
| 18 | + | unit.SetMachine(machine); |
| 19 | } | |
| 20 | } | |
| 21 | ||
| 22 | ||
| 23 | ||
| 24 | void OnMouseExit(){
| |
| 25 | ||
| 26 | guiTexture.texture = normal; | |
| 27 | ||
| 28 | ||
| 29 | } | |
| 30 | } |