Advertisement
Guest User

Untitled

a guest
May 27th, 2015
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class EjemploScript : MonoBehaviour
  5. {
  6. void Update ()
  7. {
  8. //Condicion 1
  9. if(Input.GetKeyDown(KeyCode.R))
  10. {
  11. GetComponent<Renderer>().material.color = Color.red;
  12. }
  13. //Condicion 2
  14. if (Input.GetKeyDown(KeyCode.G))
  15. {
  16. GetComponent<Renderer>().material.color = Color.green;
  17. }
  18. if (Input.GetKeyDown(KeyCode.B))
  19. {
  20. GetComponent<Renderer>().material.color = Color.blue;
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement