Beispiel #1
0
 /// <summary>
 /// Salida del panel selección .
 /// </summary>
 public void exitpaneles()
 {
     CorchetesTranfAccion.localPosition = posInitialAction;
     posAction   = posInitialAction;
     levelAccion = 0;
     Accions.SetActive(false);
     TriggerMoveAction = false;
     print("estos es una salida");
 }
Beispiel #2
0
    void entraceSelector()
    {
        if (LibreriaS == null)
        {
            LibreriaS = FindObjectOfType <libreriaDeScrips>();
        }


        //level 3 accion select
        if (TriggerMoveAction == true && Input.GetKeyDown(KeyCode.C) && brawlerMode == false ||
            Input.GetKeyDown(KeyCode.C) && brawlerMode == true && TriggerMoveAction == true
            )
        {
            exitpaneles();

            LibreriaS.audioMenus.Audio.Play();
        }

        else if (Input.GetKeyDown(KeyCode.C) && brawlerMode == true && TriggerMoveAction == false)
        {
            if (LibreriaS == null)
            {
                LibreriaS = FindObjectOfType <libreriaDeScrips>();
            }

            LibreriaS.Batalla.exitInventaryPanel();
            LibreriaS.audioMenus.Audio.Play();
        }


        else if (TriggerMoveAction == true && PausaSelector == false)
        {
            ///posicion del selector
            if (listTables[levelHorizontal].Item[LvlsVertical[levelHorizontal]].EfectoAlEquiparItenJugador == false)
            {
                MovSeleccionaAccionNormal();
            }
            if (listTables[levelHorizontal].Item[LvlsVertical[levelHorizontal]].EfectoAlEquiparItenJugador == true)
            {
                moveLvlActionEquipar();
            }
            ///acciones  a ejecutar
            if (CorchetesTranfAccion.localPosition == posAction)
            {
                ///dependiendo de si  el iten es para el jugador o para la criatura se ejecuta el iten
                if (listTables[levelHorizontal].Item[LvlsVertical[levelHorizontal]].EfectoAlEquiparItenJugador == false)
                {
                    AccionesNormal();
                }
                else if (listTables[levelHorizontal].Item[LvlsVertical[levelHorizontal]].EfectoAlEquiparItenJugador == true)
                {
                    AccionEquipar();
                }
            }
        }



        else if (TriggerMoveAction == false)
        {
            //movimiento por los item
            MoveHorizontal();

            CorchetesTranfTablas[levelHorizontal].localPosition = Vector3.MoveTowards(CorchetesTranfTablas[levelHorizontal].localPosition, pos[levelHorizontal], speed * Time.deltaTime); // Move there square braket

            panel[levelHorizontal].localPosition = Vector3.MoveTowards(panel[levelHorizontal].localPosition, panelPos[levelHorizontal], speed * Time.deltaTime);                          // Move there panel select

            // movimiento por las tablas
            MoveTable();

            // texto de descripcion
            if (listTables[levelHorizontal].Item.Count != 0)
            {
                TextInfoObj.text = listTables[levelHorizontal].Item[LvlsVertical[levelHorizontal]].descripcionItem;
            }
            else if (listTables[levelHorizontal].Item.Count == 0)
            {
                TextInfoObj.text = "";
            }


            if (Input.GetKeyDown(KeyCode.Space) && listTables[levelHorizontal].Item.Count != 0 && listTables[levelHorizontal].Item[LvlsVertical[levelHorizontal]].cantidad != 0)
            {
                DefineTextoAccion();
                Accions.SetActive(true);
                TriggerMoveAction = true;
            }


            //consumible
            if (levelHorizontal == 0)
            {
                //level 2 move en vertical iten
                LvlsVertical[levelHorizontal] = MoveLevelVertival(LvlsVertical[levelHorizontal]);
                TextZonaMochila.text          = "Consumible";

                imagenMochila.sprite = MochilaImagenes[0];

                Consumible.SetActive(true);
            }
            //Attacks
            else if (levelHorizontal == 1)
            {
                LvlsVertical[levelHorizontal] = MoveLevelVertival(LvlsVertical[levelHorizontal]);

                TextZonaMochila.text = "Attacks";

                imagenMochila.sprite = MochilaImagenes[1];
                Attacks.SetActive(true);
            }
            //objClaves
            else if (levelHorizontal == 2)
            {
                LvlsVertical[levelHorizontal] = MoveLevelVertival(LvlsVertical[levelHorizontal]);
                TextZonaMochila.text          = "ObjClave";
                imagenMochila.sprite          = MochilaImagenes[4];
                ObjClave.SetActive(true);
                // Debug.Log();
            }
            //Frutas
            else if (levelHorizontal == 3)
            {
                LvlsVertical[levelHorizontal] = MoveLevelVertival(LvlsVertical[levelHorizontal]);

                TextZonaMochila.text = "Frutas";

                imagenMochila.sprite = MochilaImagenes[2];

                Frutas.SetActive(true);
            }
            //Jaulas
            else if (levelHorizontal == 4)
            {
                LvlsVertical[levelHorizontal] = MoveLevelVertival(LvlsVertical[levelHorizontal]);

                TextZonaMochila.text = "Cartuchos";

                imagenMochila.sprite = MochilaImagenes[3];
                Jaulas.SetActive(true);
            }
            //stand
            else if (levelHorizontal == 5)
            {
                LvlsVertical[levelHorizontal] = MoveLevelVertival(LvlsVertical[levelHorizontal]);

                TextZonaMochila.text = "Stands";


                imagenMochila.sprite = MochilaImagenes[5];
                Stands.SetActive(true);
            }
            //objEfect
            else if (levelHorizontal == 6)
            {
                LvlsVertical[levelHorizontal] = MoveLevelVertival(LvlsVertical[levelHorizontal]);

                TextZonaMochila.text = "ObjEfects";

                imagenMochila.sprite = MochilaImagenes[4];
                ObjEfects.SetActive(true);
            }
        }
        DisableObj();
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        LibreriaS = GameObject.Find("Game Manager").GetComponent <libreriaDeScrips>();

        //lista de item



        for (int i = 0; i < listTables.Length; i++)
        {
            listTables[i].Item = new List <BaseItem>();
        }


        //--- Mochila ---
        imagenMochila = GameObject.Find("objetos/objetos/animacion mochila/mochila").GetComponent <Image>();

        imagenMochila.sprite = MochilaImagenes[0];

        //gameobject

        Consumible = GameObject.Find("objetos/objetos/Consumibles");

        Attacks = GameObject.Find("objetos/objetos/Attacks");

        ObjClave = GameObject.Find("objetos/objetos/ObjClaves");

        Frutas = GameObject.Find("objetos/objetos/Frutas");

        Jaulas = GameObject.Find("objetos/objetos/Jaulas");

        Stands = GameObject.Find("objetos/objetos/Stands");

        ObjEfects = GameObject.Find("objetos/objetos/ObjEfect");

        Accions = GameObject.Find("objetos/objetos/accion");


        // obj tablas



        //----------------------------
        //tables RecTransfor

        panel[0] = GameObject.Find("objetos/objetos/Consumibles/mask panel/limit object").GetComponent <RectTransform>();

        panel[1] = GameObject.Find("objetos/objetos/Attacks/mask panel/limit object").GetComponent <RectTransform>();

        panel[2] = GameObject.Find("objetos/objetos/ObjClaves/mask panel/limit object").GetComponent <RectTransform>();

        panel[3] = GameObject.Find("objetos/objetos/Frutas/mask panel/limit object").GetComponent <RectTransform>();

        panel[4] = GameObject.Find("objetos/objetos/Jaulas/mask panel/limit object").GetComponent <RectTransform>();

        panel[5] = GameObject.Find("objetos/objetos/Stands/mask panel/limit object").GetComponent <RectTransform>();

        panel[6] = GameObject.Find("objetos/objetos/ObjEfect/mask panel/limit object").GetComponent <RectTransform>();


        //------------------------------
        //Corchetes Rectransfor #7
        CorchetesTranfTablas[0] = GameObject.Find("objetos/objetos/Consumibles/mask panel/limit object/corchetes menu").GetComponent <RectTransform>();

        CorchetesTranfTablas[1] = GameObject.Find("objetos/objetos/Attacks/mask panel/limit object/corchetes menu").GetComponent <RectTransform>();

        CorchetesTranfTablas[2] = GameObject.Find("objetos/objetos/ObjClaves/mask panel/limit object/corchetes menu").GetComponent <RectTransform>();

        CorchetesTranfTablas[3] = GameObject.Find("objetos/objetos/Frutas/mask panel/limit object/corchetes menu").GetComponent <RectTransform>();

        CorchetesTranfTablas[4] = GameObject.Find("objetos/objetos/Jaulas/mask panel/limit object/corchetes menu").GetComponent <RectTransform>();

        CorchetesTranfTablas[5] = GameObject.Find("objetos/objetos/Stands/mask panel/limit object/corchetes menu").GetComponent <RectTransform>();

        CorchetesTranfTablas[6] = GameObject.Find("objetos/objetos/ObjEfect/mask panel/limit object/corchetes menu").GetComponent <RectTransform>();



        // texto  de los objetos

        TextInfoObj = GameObject.Find("objetos/objetos/infoObjeto/text").GetComponent <Text>();

        TextZonaMochila = GameObject.Find("objetos/objetos/zona de la mochila/text").GetComponent <Text>();



        ReferencePanel = GameObject.Find("ObjNameXcantidad").GetComponent <RectTransform>();

        TextAccions = GameObject.Find("objetos/objetos/accion/text").GetComponent <Text>();

        CorchetesTranfAccion = GameObject.Find("objetos/objetos/accion/Corchete").GetComponent <RectTransform>();

        ModoBatallaScript = GameObject.Find("baltle interfaceC/baltle interface").GetComponent <animationScritpBatle>();

        posAction        = CorchetesTranfAccion.localPosition; // Take the current position
        posInitialAction = CorchetesTranfAccion.localPosition;



        for (int i = 0; i <= 6; i++)
        {
            pos[i]             = CorchetesTranfTablas[i].localPosition; // Take the current position
            posInitial[i]      = CorchetesTranfTablas[i].localPosition;
            panelPos[i]        = panel[i].localPosition;
            panelPosInitial[i] = panel[i].localPosition;

            DisableObj();
        }

        //    ItemsListaGuardadas = new ListdeInventarioAGuardar[7];



        for (int i = 0; i < CajaItems.Count; i++)
        {
            DefineList(CajaItems[i]);
        }



        ItenEquipado = new Botas();
        // entraceSelector();
        Accions.SetActive(false);
    }