Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2014
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. [RequireComponent (typeof(SpriteRenderer))]
  5. //[RequireComponent (typeof(Collider2D))]
  6. public class Lootable : MonoBehaviour
  7. {
  8.  
  9.         // Use this for initialization
  10.         void Start ()
  11.         {
  12.                 print ("Im start: " + name);
  13.         }
  14.    
  15.  
  16.         void OnMouseDown ()
  17.         {
  18.                 print ("Clickety");
  19.         }
  20.  
  21.         void OnHover (bool isOver)
  22.         {
  23.                 if (isOver) {
  24.                         print ("NGUI FTW");
  25.                         renderer.material.color = Color.red;
  26.                 } else {
  27.                         renderer.material.color = Color.white;
  28.                 }
  29.  
  30.         }
  31.  
  32.         void OnPress (bool isDown)
  33.         {
  34.                 if (isDown) {
  35.                    
  36.                         print ("NGUI CLICK!");
  37.                 } else {
  38.                         print ("MouseUp");
  39.                 }
  40.         }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement