Example #1
0
    private void Start()
    {
        GameObject controlObject = GameObject.FindWithTag("ControlDeVida");

        if (controlObject != null)
        {
            controladorDeVida = controlObject.GetComponent <ControladorDeVida>();
        }
    }
    private void Start()
    {
        GameObject gameControlerObject = GameObject.FindWithTag("GameController");

        if (gameControlerObject != null)
        {
            controladorDeJuego = gameControlerObject.GetComponent <ControladorDeJuego>();
        }
        if (controladorDeJuego == null)
        {
            Debug.Log("No se ha encontrado 'ControladorDeJuego' script");
        }

        GameObject controlObject = GameObject.FindWithTag("ControlDeVida");

        if (controlObject != null)
        {
            controladorDeVida = controlObject.GetComponent <ControladorDeVida>();
        }
    }