Quantcast
Channel: Unity3D Student » gui
Viewing all articles
Browse latest Browse all 3

Beginner B25 – GUI Texture & Mouse Events

$
0
0

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 all articles
Browse latest Browse all 3

Trending Articles