Beispiel #1
0
    public void pintaObjetos()
    {
        int posicion = 0;

        foreach (Item i in inventario.listaObjetos)
        {
            GameObject    instanciaObj = Instantiate(objeto);
            eventosObjeto ev           = instanciaObj.GetComponent <eventosObjeto>();
            instanciaObj.transform.localScale = new Vector3(1f, 1f, 1f);
            ev.id       = i.id;
            ev.posicion = posicion;
            if (i.Casilla == Casilla.MANO_DERECHA || i.Casilla == Casilla.MANO_IZQUIERDA || i.Casilla == Casilla.DOS_MANOS)
            {
                Item detalle = manejador.buscarArmaId(i.id);
                instanciaObj.transform.GetComponentInChildren <Text>().text = detalle.nombre;
                instanciaObj.transform.SetParent(this.transform);
            }
            else
            {
                Item   detalle = manejador.buscarArmaduraId(i.id);
                string prueba  = detalle.nombre;
                instanciaObj.transform.GetComponentInChildren <Text>().text = prueba;
            }
            posicion++;
        }
    }
Beispiel #2
0
 public void agregarObjeto(int id)
 {
     if (handler.existeArma(id) && canAdd(id))
     {
         IArma temp = handler.buscarArmaId(id);
         listaObjetos.Add(temp);
     }
     else if (handler.existeArmadura(id) && canAdd(id))
     {
         IArmadura temp = handler.buscarArmaduraId(id);
         listaObjetos.Add(temp);
     }
     else
     {
         //agregar pociones
     }
 }