예제 #1
0
    private void handleCardsSwitch(GlobalEnums.Directions _direction)
    {
        SC_MenuLogic.buttonClick.Play();

        if (_direction == GlobalEnums.Directions.Left)
        {
            if (currentCardIndex == -1)
            {
                currentCardIndex = pokemonListSize - 1;
            }
            else if (currentCardIndex == 0)
            {
                currentCardIndex = -1;
            }
            else
            {
                currentCardIndex--;
            }
        }
        else if (_direction == GlobalEnums.Directions.Right)
        {
            if (currentCardIndex == -1)
            {
                currentCardIndex = 0;
            }
            else if (currentCardIndex == pokemonListSize - 1)
            {
                currentCardIndex = -1;
            }
            else
            {
                currentCardIndex++;
            }
        }

        if (currentCardIndex == -1)
        {
            Button_PokemonCard.image.sprite = randomPokemonCard;
            Text_PokemonName.text           = "Random Pokemon";
        }
        else
        {
            Button_PokemonCard.image.sprite = SC_GameLogic.allPokemons[currentCardIndex].cardImage;
            Text_PokemonName.text           = SC_GameLogic.allPokemons[currentCardIndex].name;
        }
    }
    public void handleMusicSlider(GlobalEnums.Directions _direction)
    {
        if (_direction == GlobalEnums.Directions.Left)
        {
            if (musicSliderValue > 0 && musicSliderValue <= 10)
            {
                musicSliderValue--;
            }
        }
        else if (_direction == GlobalEnums.Directions.Right)
        {
            if (musicSliderValue >= 0 && musicSliderValue < 10)
            {
                musicSliderValue++;
            }
        }

        Slider_Music.value = musicSliderValue;

        updateAllMusic();
    }
    public void handleSfxSlider(GlobalEnums.Directions _direction)
    {
        if (_direction == GlobalEnums.Directions.Left)
        {
            if (sfxSliderValue > 0 && sfxSliderValue <= 10)
            {
                sfxSliderValue--;
            }
        }
        else if (_direction == GlobalEnums.Directions.Right)
        {
            if (sfxSliderValue >= 0 && sfxSliderValue < 10)
            {
                sfxSliderValue++;
            }
        }

        Slider_Sfx.value = sfxSliderValue;

        updateAllSfx();
    }
예제 #4
0
    private void handleLevelSlider(GlobalEnums.Directions _direction)
    {
        SC_MenuLogic.sliderClick.Play();

        if (_direction == GlobalEnums.Directions.Left)
        {
            if (currentSliderValue > 5 && currentSliderValue <= 100)
            {
                currentSliderValue--;
            }
        }
        else if (_direction == GlobalEnums.Directions.Right)
        {
            if (currentSliderValue >= 5 && currentSliderValue < 100)
            {
                currentSliderValue++;
            }
        }

        Text_LevelNumber.text = currentSliderValue.ToString();
        Slider_Level.value    = currentSliderValue;
    }