12345678910111213141516171819202122 |
- using UnityEngine;
- using System.Collections;
- public class GUIButton : MonoBehaviour {
- public Texture textureOut;
- public Texture textureOver;
- // Use this for initialization
- void OnMouseEnter ()
- {
- if(textureOver != null)
- GetComponent<Renderer>().material.mainTexture = textureOver;
- }
-
- // Update is called once per frame
- void OnMouseExit ()
- {
- if(textureOut != null)
- GetComponent<Renderer>().material.mainTexture = textureOut;
- }
- }
|