示例#1
0
    void DisableObj()
    {
        if (levelHorizontal != 0 && Consumible.activeSelf == true)
        {
            Consumible.SetActive(false);
        }

        else if (levelHorizontal != 1 && Attacks.activeSelf == true)
        {
            Attacks.SetActive(false);
        }

        else if (levelHorizontal != 2 && ObjClave.activeSelf == true)
        {
            ObjClave.SetActive(false);
        }

        else if (levelHorizontal != 3 && Frutas.activeSelf == true)
        {
            Frutas.SetActive(false);
        }
        else if (levelHorizontal != 4 && Jaulas.activeSelf == true)
        {
            Jaulas.SetActive(false);
        }
        else if (levelHorizontal != 5 && Stands.activeSelf == true)
        {
            Stands.SetActive(false);
        }
        else if (levelHorizontal != 6 && ObjEfects.activeSelf == true)
        {
            ObjEfects.SetActive(false);
        }
    }
示例#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();
    }