コード例 #1
0
ファイル: PaHabScript.cs プロジェクト: Jaztek/Gladio
 public void OnEndDrag(PointerEventData eventData)
 {
     habilityBeingDragged = null;
     transform.position   = startPosition;
     transform.SetParent(transformParent);
     GetComponent <CanvasGroup>().blocksRaycasts = true;
 }
コード例 #2
0
ファイル: PaHabScript.cs プロジェクト: Jaztek/Gladio
 public void inicializar(string nombreHab, float damageHab, float CCHab, float proxHab, HabilidadTemplate habilidad)
 {
     nombre.text     = nombreHab;
     damage.text     = damageHab.ToString();
     CC.text         = CCHab.ToString();
     prox.text       = proxHab.ToString();
     habilidadSingle = habilidad;
 }
コード例 #3
0
 public void limpiarBtLimpiar()
 {
     nombre.text     = "Vacio";
     damage.text     = "";
     CC.text         = "";
     prox.text       = "";
     habSeleccionada = null;
 }
コード例 #4
0
ファイル: SaveLoad.cs プロジェクト: Jaztek/Gladio
    public static void removeHabilidadConjunto1(HabilidadTemplate habTemp)
    {
        List <HabilidadTemplate> habilidades = SaveLoad.getPlayerTemp().getHabilidadesConjunto1();

        habilidades.Remove(habTemp);
        playerTemplate.setHabilidadesConjunto1(habilidades);
        savePlayerTemp(playerTemplate);
    }
コード例 #5
0
ファイル: PaHabScript.cs プロジェクト: Jaztek/Gladio
    public void OnBeginDrag(PointerEventData eventData)
    {
        habilityBeingDragged = habilidadSingle;
        transformParent      = transform.parent;
        transform.SetParent(canvas.transform);
        startPosition = transform.position;

        GetComponent <CanvasGroup>().blocksRaycasts = false;
    }
コード例 #6
0
 public void pintarHabilidadSeleccionada(HabilidadTemplate hab)
 {
     nombre.text     = hab.nombre;
     damage.text     = hab.damage.ToString();
     CC.text         = hab.cooldown.ToString();
     prox.text       = hab.maxProximity.ToString();
     hab.prioridad   = prioridad;
     habSeleccionada = hab;
 }
コード例 #7
0
    public void pintarHabilidadSeleccionada(HabilidadTemplate hab)
    {
        paHabilidades.SetActive(false);

        nombre.text     = hab.nombre;
        damage.text     = hab.damage.ToString();
        CC.text         = hab.cooldown.ToString();
        prox.text       = hab.maxProximity.ToString();
        habSeleccionada = hab;
    }
コード例 #8
0
ファイル: SaveLoad.cs プロジェクト: Jaztek/Gladio
    public static void saveHabilidadConjunto1(HabilidadTemplate habTemp)
    {
        List <HabilidadTemplate> habilidades = SaveLoad.getPlayerTemp().getHabilidadesConjunto1();
        HabilidadTemplate        habCambiada = null;

        habilidades.ForEach(h => {
            if (h.prioridad == habTemp.prioridad)
            {
                habCambiada = h;
            }
        });
        if (habCambiada != null)
        {
            habilidades.Remove(habCambiada);
        }
        habilidades.Add(habTemp);
        playerTemplate.setHabilidadesConjunto1(habilidades);
        savePlayerTemp(playerTemplate);
    }
コード例 #9
0
    public void OnDrop(PointerEventData eventData)
    {
        HabilidadTemplate habTemplate = eventData.pointerDrag.gameObject.GetComponentInChildren <PaHabScript>().getHabilidad();
        List <GameObject> habilidades = new List <GameObject>(GameObject.FindGameObjectsWithTag("Habilidad"));

        habilidades.ForEach(h =>
        {
            if (habTemplate == h.GetComponentInChildren <BtHabInicioScript>().getHabilidad())
            {
                if (habSeleccionada != null)
                {
                    h.GetComponentInChildren <BtHabInicioScript>().pintarHabilidadSeleccionada(habSeleccionada);
                }
                else
                {
                    h.GetComponentInChildren <BtHabInicioScript>().limpiarBtLimpiar();
                }
            }
        });

        pintarHabilidadSeleccionada(habTemplate);
        SaveLoad.saveHabilidadConjunto1(habTemplate);
    }
コード例 #10
0
ファイル: SaveLoad.cs プロジェクト: Jaztek/Gladio
    public static void chargeLoot()
    {
        List <HabilidadTemplate> listHabilid = new List <HabilidadTemplate>();

        //por defecto le metemos uno a piñon para las pruebas.
        HabilidadTemplate habilidaBuild1 = new HabilidadTemplate();

        habilidaBuild1.nombre       = "habEspadazo";
        habilidaBuild1.maxProximity = 5;
        habilidaBuild1.damage       = 5;
        habilidaBuild1.cooldown     = 5;
        listHabilid.Add(habilidaBuild1);

        HabilidadTemplate habilidaBuild2 = new HabilidadTemplate();

        habilidaBuild2.nombre       = "habEstocada";
        habilidaBuild2.maxProximity = 5;
        habilidaBuild2.damage       = 5;
        habilidaBuild2.cooldown     = 5;
        listHabilid.Add(habilidaBuild2);

        HabilidadTemplate habilidaBuild3 = new HabilidadTemplate();

        habilidaBuild3.nombre       = "habEscudo";
        habilidaBuild3.maxProximity = 5;
        habilidaBuild3.damage       = 5;
        habilidaBuild3.cooldown     = 5;
        listHabilid.Add(habilidaBuild3);

        HabilidadTemplate habilidaBuild4 = new HabilidadTemplate();

        habilidaBuild4.nombre       = "habSalto";
        habilidaBuild4.maxProximity = 5;
        habilidaBuild4.damage       = 5;
        habilidaBuild4.cooldown     = 5;
        listHabilid.Add(habilidaBuild4);

        HabilidadTemplate habilidaBuild5 = new HabilidadTemplate();

        habilidaBuild5.nombre       = "habArrowBasic";
        habilidaBuild5.maxProximity = 15;
        habilidaBuild5.damage       = 5;
        habilidaBuild5.cooldown     = 5;
        listHabilid.Add(habilidaBuild5);

        HabilidadTemplate habilidaBuild6 = new HabilidadTemplate();

        habilidaBuild6.nombre = "habReduccionDano";
        listHabilid.Add(habilidaBuild6);

        HabilidadTemplate habilidaBuild7 = new HabilidadTemplate();

        habilidaBuild7.nombre   = "habCura";
        habilidaBuild7.curacion = 20;
        habilidaBuild7.cooldown = 25;
        listHabilid.Add(habilidaBuild7);

        HabilidadTemplate habilidaBuild8 = new HabilidadTemplate();

        habilidaBuild8.nombre       = "habPasoSombras";
        habilidaBuild8.maxProximity = 15;
        habilidaBuild8.damage       = 10;
        habilidaBuild8.cooldown     = 10;
        listHabilid.Add(habilidaBuild8);



        getPlayerTemp().addHabilidades(listHabilid);


        List <ItemTemplate> listItem = new List <ItemTemplate>();
        ItemTemplate        item1    = new ItemTemplate();

        item1.identificador = "head1";
        item1.itemLevel     = 1;
        listItem.Add(item1);

        ItemTemplate item2 = new ItemTemplate();

        item2.identificador = "head2";
        item2.itemLevel     = 1;
        listItem.Add(item2);

        ItemTemplate item3 = new ItemTemplate();

        item3.identificador = "head3";
        item3.itemLevel     = 1;
        listItem.Add(item3);

        ItemTemplate item4 = new ItemTemplate();

        item4.identificador = "head4";
        item4.itemLevel     = 1;
        listItem.Add(item4);

        ItemTemplate item5 = new ItemTemplate();

        item5.identificador = "tronco1";
        item5.itemLevel     = 1;
        listItem.Add(item5);

        ItemTemplate item6 = new ItemTemplate();

        item6.identificador = "tronco2";
        item6.itemLevel     = 1;
        listItem.Add(item6);

        ItemTemplate item7 = new ItemTemplate();

        item1.identificador = "tronco3";
        item7.itemLevel     = 1;
        listItem.Add(item7);

        ItemTemplate item8 = new ItemTemplate();

        item8.identificador = "tronco4";
        item8.itemLevel     = 1;
        listItem.Add(item8);

        ItemTemplate item9 = new ItemTemplate();

        item9.identificador = "zapas1";
        item9.itemLevel     = 1;
        listItem.Add(item9);

        ItemTemplate item10 = new ItemTemplate();

        item10.identificador = "zapas2";
        item10.itemLevel     = 1;
        listItem.Add(item10);

        ItemTemplate item11 = new ItemTemplate();

        item11.identificador = "zapas3";
        item11.itemLevel     = 1;
        listItem.Add(item11);

        ItemTemplate item12 = new ItemTemplate();

        item12.identificador = "zapas4";
        item12.itemLevel     = 1;
        listItem.Add(item12);

        getPlayerTemp().addItems(listItem);


        List <WeaponTemplate> listWeap = new List <WeaponTemplate>();

        WeaponTemplate weap = new WeaponTemplate();

        weap.identificador = "arpon1";
        weap.weaponLevel   = 1;
        listWeap.Add(weap);

        WeaponTemplate weap1 = new WeaponTemplate();

        weap1.identificador = "axe1";
        weap1.weaponLevel   = 1;
        listWeap.Add(weap1);

        WeaponTemplate weap2 = new WeaponTemplate();

        weap2.identificador = "axe2";
        weap2.weaponLevel   = 1;
        listWeap.Add(weap2);

        WeaponTemplate weap3 = new WeaponTemplate();

        weap3.identificador = "dest1";
        weap3.weaponLevel   = 1;
        listWeap.Add(weap3);

        WeaponTemplate weap4 = new WeaponTemplate();

        weap4.identificador = "mace1";
        weap4.weaponLevel   = 1;
        listWeap.Add(weap4);

        getPlayerTemp().addWeapons(listWeap);


        savePlayerTemp(playerTemplate);
    }