// Start is called before the first frame update void Start() { //SPRITES OBSTACULOS spritesObstaculos = this.transform.GetChild(0).gameObject; //VARIABLES TAXI timer = 0; timerRandom = Random.Range(-intervaloTimerRandom, -intervaloTimerRandom); listaTaxisCreados = new List <GameObject>(); //VARIABLES OBSTACULO xInicial = personaje.transform.position.x; xPasada = xInicial; listaObstaculosCreados = new List <GameObject>(); //VARIABLES GLOBALES scriptDistancia = personaje.GetComponent <distancia>(); scriptInput = personaje.GetComponent <input>(); scriptVida = personaje.GetComponent <vida>(); //CREO ENEMIGOS INICIALES posicionObstaculo.x = personaje.transform.position.x - campoVisual / 2; posicionObstaculo.y = scriptInput.targetyabajo; posicionObstaculo.z = -5; instanciaEnfermero = Instantiate(enemigo, posicionObstaculo, Quaternion.identity); posicionObstaculo.y = scriptInput.targetyarriba; Instantiate(enemigo, posicionObstaculo, Quaternion.identity); }
// Start is called before the first frame update void Start() { this.posVertical = posicionVertical.abajo; patron = new KeyPattern(); patron.umbral = this.umbral; movimientoHorizontal = false; movimientoVertical = false; energia = this.GetComponent <Energia>(); distancia = this.GetComponent <distancia>(); }