View difference between Paste ID: 4bSu9tDV and qGbPmEKm
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
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-
			Unit.SendMessage("SetMachine", machine);
18+
19
			unit.SetMachine(machine);
20
		}
21
	}
22
23
24
25
	void OnMouseExit(){
26
		
27
		guiTexture.texture = normal;
28
		
29
		
30
	}
31
}