Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1.  
  2. // button-veggie
  3. // Veggie buttons
  4.  
  5.  
  6. var newmat:Material;
  7.  
  8. function Start()
  9. {
  10. newmat = Resources.Load("tx-temp-reddot");
  11. }
  12.  
  13. function OnMouseOver ()
  14. {
  15. if (Input.GetMouseButtonDown(0))
  16. {
  17. //renderer.material = newmat; // swaps the texture on click
  18.  
  19. // renderer.material.color -= Color(100, 100, 0) * Time.deltaTime; // changes tint - don't know what time.deltaTime is for?
  20. // renderer.material.color -=Color(0.2, 0.3, 0.4, 0.5); // R,G,B,A 1 is 255
  21.  
  22. renderer.material.color -=Color(.8, .7, .6, 0); // R,G,B,A 1 is 255
  23. Debug.Log("Clicked: "+gameObject.name);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement