Exemplo n.º 1
0
 //
 public void guardarNumNivelBtn(string nomBloque)
 {
     for (int i = 0; i < 16; i++)
     {
         if (nomBloque == "Button (" + i + ")")
         {
             botonCrear bt = GameObject.Find(nomBloque).GetComponent <botonCrear>();
             PlayerPrefs.SetInt("nivel", i + 1);
             SceneManager.LoadScene("galaxia1");
         }
     }
 }
Exemplo n.º 2
0
 // guardarBloque = cada vez q se toca un bloque nuevo este lo guarda al vector
 public void guardarBloque(string nomBloque, int color)
 {
     for (int i = 0; i < 220; i++)
     {
         if (nomBloque == "Button (" + i + ")")
         {
             botonCrear bt = GameObject.Find(nomBloque).GetComponent <botonCrear>();
             bloque[i].pos   = (byte)i;
             bloque[i].color = (byte)bt.nColor;
         }
     }
 }
Exemplo n.º 3
0
    public void OnButtonClick()
    {
        scriptMantenerColor = GameObject.Find("crear").GetComponent <mantenerColor>();//busca el objeto del script y lo asigna a la variable
        var go = EventSystem.current.currentSelectedGameObject;

        componenteImagen = GetComponent <Button>();
        botonCrear scriptBotonCrear = GameObject.Find(go.name).GetComponent <botonCrear>(); //le paso el nombre asi busca el objeto boton para traer su componente

        scriptBotonCrear.nColor = scriptMantenerColor.color;                                //HAY QUE TRAER ESTA MIERDA TODO HAY QUE TRAER SINO NO LO GUARDA!!
        crearNivel = GameObject.Find("crear").GetComponent <crearNiveles>();                //busca el objeto del script y lo asigna a la variable

        crearNivel.guardarBloque(go.name, scriptMantenerColor.color);                       //SIEMPRE HAY QUE BUSCAR ANTES EL OBJETO SINO NO FUNCIONA!!-------------------------------------------
    }