Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class EjemploScript : MonoBehaviour
- {
- void Update ()
- {
- //Condicion 1
- if(Input.GetKeyDown(KeyCode.R))
- {
- GetComponent<Renderer>().material.color = Color.red;
- }
- //Condicion 2
- if (Input.GetKeyDown(KeyCode.G))
- {
- GetComponent<Renderer>().material.color = Color.green;
- }
- if (Input.GetKeyDown(KeyCode.B))
- {
- GetComponent<Renderer>().material.color = Color.blue;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement