public void matchear(InformacionDelObjeto info)
    {
        titulo.text = info.transform.name;
        //descipcion.text = info.descipcion;
        infoComoSoy.text         = info.infoComoSoy;
        infoComoMeAdapto.text    = info.infoComoMeAdapto;
        infoComoMeRelaciono.text = info.infoComoMeRelaciono;
        infoSabiasQue.text       = info.infoSabiasQue;
        juegoPregunta.text       = info.juegoPregunta;
        juegoRespuesta.text      = info.juegoRespuesta;
        string op = "";

        for (int i = 0; i < info.juegoOpciones.Length; i++)
        {
            op += "(" + (i + 1) + ") " + info.juegoOpciones [i] + "\n";
        }
        juegoOpciones.text = op;
        juegoFoto.sprite   = imagenes.transform.Find(info.juegoFoto).GetComponent <Image> ().sprite;
        GetComponent <ControladorFotos> ().fotos = info.fotos;
        GetComponent <ControladorFotos> ().iniciar();
        //lo mismo para videos y links
        GetComponent <ControladorLinks>().linksNombre = info.linksNombres;
        GetComponent <ControladorLinks>().linksURLs   = info.linksURLs;
        GetComponent <ControladorLinks> ().iniciar();
    }
示例#2
0
 public void agregar(InformacionDelObjeto info)
 {
     if (!puntos.Contains(info))
     {
         puntos.Add(info);
         GameObject nuevo = Instantiate(prefab) as GameObject;
         botones.Add(nuevo);
         nuevo.transform.parent = contenedor.transform;
         nuevo.transform.name   = info.name;
         string n = info.nombre;
         if (n.Length > 25)
         {
             n = n.Substring(0, 25) + "...";
         }
         nuevo.transform.GetChild(1).GetComponent <Text> ().text = n;
         nuevo.GetComponent <BotonPrefab> ().indice = puntos.Count - 1;
         nuevo.transform.Find("Image").GetComponent <Image> ().sprite = GameObject.Find(info.nombre).transform.Find("Nivel2").Find("Button").GetComponent <Image> ().sprite;
     }
     if (puntos.Count == 1)
     {
         seleccionar(0);
         contenedor.SetActive(false);
     }
     else
     {
         contenedor.SetActive(true);
     }
 }
    public void checkearNulos(InformacionDelObjeto info)
    {
        btnJuego.SetActive(true);
        btnImagenes.SetActive(true);
        //btnVideos.SetActive (true);
        btnLinks.SetActive(true);
        btnComoSoy.SetActive(true);
        btnComoMeRelaciono.SetActive(true);
        btnComoMeAdapto.SetActive(true);
        btnSabiasQue.SetActive(true);

        //Debug.Log ("hola");

        if (info.infoComoSoy == null)
        {
            btnComoSoy.SetActive(false);
        }
        if (info.infoComoMeRelaciono == null)
        {
            btnComoMeRelaciono.SetActive(false);
        }
        if (info.infoComoMeAdapto == null)
        {
            btnComoMeAdapto.SetActive(false);
        }
        if (info.infoSabiasQue == null)
        {
            btnSabiasQue.SetActive(false);
        }
        if (info.juegoPregunta == null)
        {
            btnJuego.SetActive(false);
        }
        if (info.fotos == null)
        {
            btnImagenes.SetActive(false);
        }
        if (info.videos == null)
        {
            btnVideos.SetActive(false);
        }
        if (info.linksNombres == null)
        {
            btnLinks.SetActive(false);
        }
    }
示例#4
0
    public void matchear(InformacionDelObjeto info)
    {
        titulo.text           = info.transform.name;
        informacionPosta.text = info.descipcion;
        string op = "";

        for (int i = 0; i < info.juegoOpciones.Length; i++)
        {
            op += "(" + (i + 1) + ") " + info.juegoOpciones [i] + "\n";
        }
        GetComponent <ControladorFotos> ().fotos = info.fotos;
        GetComponent <ControladorFotos> ().iniciar();
        //lo mismo para videos y links
        GetComponent <ControladorLinks>().linksNombre = info.linksNombres;
        GetComponent <ControladorLinks>().linksURLs   = info.linksURLs;
        GetComponent <ControladorLinks> ().iniciar();
    }
示例#5
0
 public void sacar(InformacionDelObjeto info)
 {
     if (puntos.Contains(info))
     {
         puntos.Remove(info);
         GameObject removido = contenedor.transform.Find(info.name).gameObject;
         botones.Remove(removido);
         Destroy(removido);
         if (puntos.Count < 1)
         {
             GetComponent <MenuManager> ().desactivarMenuInteracciones();
         }
         if (puntos.Count == 1)
         {
             seleccionar(0);
             contenedor.SetActive(false);
         }
         else
         {
             contenedor.SetActive(true);
         }
     }
 }
示例#6
0
 public void setearDatos(InformacionDelObjeto info)
 {
     GetComponent <ReferenciasGraficas> ().matchear(info);
     GetComponent <ReferenciasGraficas> ().checkearNulos(info);
 }