Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Fase1Mono : MonoBehaviour
- {
- public MonoBehaviour PRUEBA;
- void Update ()
- {
- if(Input.GetKeyDown(KeyCode.F1))
- {
- print ("Suscribete :D");
- print ("Se ha ejecutado print(String) que muestra un mensaje en consola");
- }
- if(Input.GetKeyDown(KeyCode.F2))
- {
- PRUEBA.enabled = !PRUEBA.enabled;
- print ("Se ha Cambiado el booleano MonoBehaviour.Enabled que indica si el componente esta activo o no");
- }
- if(Input.GetKeyDown(KeyCode.F3))
- {
- Destroy (PRUEBA);
- print ("Se ha ejecutado el comando Destroy(Object) que destruye un MonoBehaviour o un GameObject");
- }
- if(Input.GetKeyDown(KeyCode.F4))
- {
- Instantiate (PRUEBA, Vector3.zero, Quaternion.identity);
- print ("Se ha ejecutado el comando Instantiate(Object, Vector3, Quaternion) que instancia un GameObject en el lugar indicado");
- }
- if(Input.GetKeyDown(KeyCode.F5))
- {
- PRUEBA.gameObject.SetActive (!PRUEBA.gameObject.activeInHierarchy);
- print ("Se ha ejecutado la funcion gameObject.SetActive(bool) que cambia el estado del game object");
- }
- if(Input.GetKeyDown(KeyCode.F6))
- {
- PRUEBA.Invoke ("HolaMundo", 1);
- print ("Se ha ejecutado el comando Invoke(String, float) que llama una funcion dentro de un tiempo determinado");
- }
- if(Input.GetKeyDown(KeyCode.F7))
- {
- print (PRUEBA.tag);
- print ("Se ha Mostrado el atributo gameObject.tag");
- }
- if(Input.GetKeyDown(KeyCode.F8))
- {
- print (PRUEBA.gameObject.layer);
- print ("Se ha Mostrado el atributo gameObject.layer");
- }
- if(Input.GetKeyDown(KeyCode.F9))
- {
- print (GameObject.Find("Prueba").tag);
- print ("Se ha ejecutado la funcion GameObject.Find(String) que devuelve un GameObject");
- }
- if(Input.GetKeyDown(KeyCode.F10))
- {
- print (GameObject.FindGameObjectWithTag("TAG DE PRUEBA").name);
- print ("Se ha ejecutado la funcion GameObject.Find(String) que devuelve un GameObject");
- }
- if(Input.GetKeyDown(KeyCode.F11))
- {
- PRUEBA.SendMessage ("HolaMundo");
- print ("Se ha ejecutado la funcion SendMessage(string) que envia un texto a un MonoBehaviour");
- }
- if(Input.GetKeyDown(KeyCode.F12))
- {
- DontDestroyOnLoad (PRUEBA);
- Application.LoadLevel (Application.loadedLevel);
- print ("Se ha ejecutado el comando DontDestroyOnLoad(Object) que evita que el Objeto sea eliminado al cambiar de escena");
- }
- if (Input.GetKeyDown (KeyCode.Tab)) {
- print (PRUEBA.GetComponent<Collider> ().isTrigger);
- print ("Se esta mostrando el componente Obtenido mediante la funcion MonoBehaviour.GetComponent<ClaseABuscar>()\nY en este caso se esta mostrando si el componente es Trigger");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement