// Use this for initialization void Start() { vida = GameObject.FindGameObjectWithTag("Vidas").GetComponent <Vidas>() as Vidas; pontos = GameObject.FindGameObjectWithTag("Pontos").GetComponent <Pontuacao>() as Pontuacao; minY = GerenciarCamera.MinY(); maxY = GerenciarCamera.MaxY(); }
// Update is called once per frame void Update() { if (botonUnJugador.pulsado) { vida = new Vidas(); vida.reiniciarVidas(); SceneManager.LoadScene("Juego1"); } if (botonDosJugadores.pulsado) { vida = new Vidas(); vida.reiniciarVidas(); SceneManager.LoadScene("Juego2"); } if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) && Input.GetKey(KeyCode.L)) {//si se ha pulsado CTRL - L se inicia dos jugadores. vida = new Vidas(); vida.reiniciarVidas(); SceneManager.LoadScene("Juego1"); } if ((Input.GetKey(KeyCode.AltGr) || Input.GetKey(KeyCode.RightAlt) || Input.GetKey(KeyCode.LeftAlt)) && Input.GetKey(KeyCode.L)) {//si se ha pulsado Alt - L se inicia un jugador vida = new Vidas(); vida.reiniciarVidas(); SceneManager.LoadScene("Juego2"); } }
// Start is called before the first frame update void Start() { rb2d = this.GetComponent <Rigidbody2D>(); animator = this.GetComponent <Animator>(); vidas = GameObject.FindObjectOfType <Vidas>(); sonido = gameObject.GetComponent <AudioSource>(); toca_suelo = true; ataque = false; vitalidad = 3.0f; }
void Awake() { DontDestroyOnLoad(this.gameObject); if (viditas == null) { DontDestroyOnLoad(this.gameObject); viditas = this; } else if (viditas == this) { Destroy(this.gameObject); } }
// Use this for initialization void Start() { manVida = FindObjectOfType <Vidas>(); manBarra = FindObjectOfType <ManejadorBarra>(); }
// Start is called before the first frame update void Start() { Vidas = FindObjectOfType(typeof(Vidas)) as Vidas; SomManagement = FindObjectOfType(typeof(SomManagement)) as SomManagement; }
// Use this for initialization void Start() { vida.fillAmount = vidaLlena; puntosVidaActual = puntosDeVidaMaximos; manVidas = FindObjectOfType <Vidas>(); }
void Awake() { pontos = GameObject.FindGameObjectWithTag("Pontos").GetComponent <Pontuacao> () as Pontuacao; vidas = GameObject.FindGameObjectWithTag("Vidas").GetComponent <Vidas> () as Vidas; }