Exemple #1
0
 void Start()
 {
     motorCarreteraGO      = GameObject.Find("MotorCarretera");
     motorCarreteraScript  = motorCarreteraGO.GetComponent <MotorCarretera>();
     controladorAutoGO     = GameObject.Find("ControladorAuto");
     controladorAutoScript = controladorAutoGO.GetComponent <ControladorAuto>();
     txtTiempo.text        = "2:00";
     txtDistancia.text     = "0";
     tiempo = 120;
 }
Exemple #2
0
 void inicioComponentes()
 {
     //Ubico el motor de carretera y el script dentro de él
     motorCarreteraGO     = GameObject.Find("MotorCarretera");
     motorCarreteraScript = motorCarreteraGO.GetComponent <MotorCarretera>();
     //Ubico el contador de números y el SpriteRenderer dentro de él
     contadorNumerosGO   = GameObject.Find("ContadorNumeros");
     contadorNumerosComp = contadorNumerosGO.GetComponent <SpriteRenderer>();
     //Ubico el auto y el controlador del auto
     autoGO                = GameObject.Find("Auto");
     controladorAutoGO     = GameObject.Find("ControladorAuto");
     controladorAutoScript = controladorAutoGO.GetComponent <ControladorAuto>();
     inicioCuentaAtras();
 }