Example #1
0
    public void ItemSwitch()
    {
        //Toogle entre las llaves que aparecen en el canvas, la llave que tienes equipada
        if (Input.GetKeyDown(KeyCode.Q))
        {
            ItemNumber++;
            if (ItemNumber > ItemCode)
            {
                ItemNumber = 1;
            }
            //Pico
            if (ItemNumber == 1)
            {
                Pico_HUD.SetActive(true);
                Guante_HUD.SetActive(false);
                Bomba_HUD.SetActive(false);
                IceBeam_HUD.SetActive(false);
            }

            //Bomba
            if (ItemNumber == 2 && secondToolCheckBombIsTrue == true)
            {
                Pico_HUD.SetActive(false);
                Guante_HUD.SetActive(false);
                Bomba_HUD.SetActive(true);
                IceBeam_HUD.SetActive(false);
            }
            else if (ItemNumber == 2 && secondToolCheckBombIsTrue == false)
            {
                Pico_HUD.SetActive(false);
                Guante_HUD.SetActive(true);
                Bomba_HUD.SetActive(false);
                IceBeam_HUD.SetActive(false);
            }
            //Freeze
            if (ItemNumber == 3)
            {
                Pico_HUD.SetActive(false);
                Guante_HUD.SetActive(false);
                Bomba_HUD.SetActive(false);
                IceBeam_HUD.SetActive(true);
            }

            //guante
            if (ItemNumber == 4 && secondToolCheckBombIsTrue == true)
            {
                Pico_HUD.SetActive(false);
                Guante_HUD.SetActive(true);
                Bomba_HUD.SetActive(false);
                IceBeam_HUD.SetActive(false);
            }
            else if (ItemNumber == 4 && secondToolCheckBombIsTrue == false)
            {
                Pico_HUD.SetActive(false);
                Guante_HUD.SetActive(false);
                Bomba_HUD.SetActive(true);
                IceBeam_HUD.SetActive(false);
            }
        }
    }
Example #2
0
    void Start()
    {
        player_RB = GetComponent <Rigidbody>();

        //Está apagando los íconos del HUD y UI
        Pico_HUD.SetActive(false);
        Guante_HUD.SetActive(false);
        Bomba_HUD.SetActive(false);
        IceBeam_HUD.SetActive(false);
        upgradeUI.SetActive(false);

        //E_K.SetActive(false);
        //GreenDoor.SetActive(true);
        //RedDoor.SetActive(true);
        //BlueDoor.SetActive(true);
    }
Example #3
0
    void OnTriggerStay(Collider other)
    {
        //Pregunta si está tocando el collider que le permite escalar
        if (other.tag == "Ladder")
        {
            Climb = true;
            player_RB.useGravity = false;
            //player_RB.constraints = RigidbodyConstraints.FreezePositionX;
        }

        //Recoge y el pico obtenible en escena
        if (other.tag == "Pico_Obtenible" && Input.GetKeyDown(KeyCode.F))
        {
            ItemCode++;
            ItemNumber++;
            ////Soluciones chacas!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
            //Pico_HUD.SetActive(true);
            Destroy(other.gameObject);
            hasPicaxe = true;

            Pico_HUD.SetActive(true);
            Guante_HUD.SetActive(false);
            Bomba_HUD.SetActive(false);
            IceBeam_HUD.SetActive(false);
        }

        //Recoge y destruye la bomba que está en la escena
        if (other.tag == "Bomba_Obtenible" && Input.GetKeyDown(KeyCode.F))
        {
            ItemCode++;
            ItemNumber++;
            //Soluciones chacas!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
            //Pico_HUD.SetActive(true);
            Destroy(other.gameObject);
            hasBomb = true;

            Pico_HUD.SetActive(false);
            Guante_HUD.SetActive(false);
            Bomba_HUD.SetActive(true);
            IceBeam_HUD.SetActive(false);
        }

        //Recoge y el Guante obtenible en escena
        if (other.tag == "Guante_Obtenible" && Input.GetKeyDown(KeyCode.F))
        {
            ItemCode++;
            //ItemNumber++;
            ////Soluciones chacas!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
            //Pico_HUD.SetActive(true);
            Destroy(other.gameObject);
            hasGuantes = true;
        }

        //Recoge y el freeze obtenible en escena
        if (other.tag == "Freeze_Obtenible")
        {
            ItemCode++;
            //ItemNumber++;
            ////Soluciones chacas!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
            //Pico_HUD.SetActive(true);
            Destroy(other.gameObject);
            hasFreeze = true;
        }

        //Dejar tus recursos en el cofre
        if (other.tag == "ResourceChest")
        {
            if (Input.GetKeyDown(KeyCode.F))
            {
                ResourceChest.chest_recurso_Jade += recurso_jade;
                recurso_jade = 0;
                ResourceChest.chest_recurso_Ruby += recurso_ruby;
                recurso_ruby = 0;
                ResourceChest.chest_recurso_Sapphire += recurso_sapphire;
                recurso_sapphire = 0;
            }
        }

        //Cambio de recursos
        if (other.tag == "UpgradeSpot")
        {
            if (Input.GetKeyDown(KeyCode.F))
            {
                Upgrades();
            }
        }
    }