Quantcast
Viewing latest article 2
Browse Latest Browse All 3

Beginner B25 – GUI Texture & Mouse Events

Using simple GUI Textures and Mouse Events to create interaction in Unity.

Code Used (Javascript)

var normalTex : Texture2D;
  1. var hoverTex : Texture2D;
  2.  
  3. function OnMouseEnter () {
  4.  guiTexture.texture = hoverTex;
  5. }
  6.  
  7. function OnMouseExit(){
  8.  guiTexture.texture = normalTex;
  9. }
  10.  
  11. function OnMouseDown(){
  12.  Debug.Log("clicked");
  13. }

Further Reading


Viewing latest article 2
Browse Latest Browse All 3

Trending Articles