unity 3d student

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

HACKED BY SudoX — HACK A NICE DAY.

Share via Social Media

  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  • Add to favorites

34 Comments