Ejemplo n.º 1
0
        override public float Run()
        {
            switch (method)
            {
            case OptionSetMethod.Language:
                if (index >= 0 && KickStarter.speechManager != null && index < KickStarter.speechManager.languages.Count)
                {
                    if (KickStarter.speechManager != null && KickStarter.speechManager.separateVoiceAndTextLanguages)
                    {
                        switch (splitLanguageType)
                        {
                        case SplitLanguageType.TextAndVoice:
                            Options.SetLanguage(index);
                            Options.SetVoiceLanguage(index);
                            break;

                        case SplitLanguageType.TextOnly:
                            Options.SetLanguage(index);
                            break;

                        case SplitLanguageType.VoiceOnly:
                            Options.SetVoiceLanguage(index);
                            break;
                        }
                    }
                    else
                    {
                        Options.SetLanguage(index);
                    }
                }
                else
                {
                    LogWarning("Could not set language to index: " + index + " - does this language exist?");
                }
                break;

            case OptionSetMethod.Subtitles:
                Options.SetSubtitles((index == 1));
                break;

            case OptionSetMethod.SpeechVolume:
                Options.SetSpeechVolume(volume);
                break;

            case OptionSetMethod.SFXVolume:
                Options.SetSFXVolume(volume);
                break;

            case OptionSetMethod.MusicVolume:
                Options.SetMusicVolume(volume);
                break;
            }

            return(0f);
        }
Ejemplo n.º 2
0
        private void UpdateValue()
        {
            if (uiSlider == null)
            {
                visualAmount = Mathf.Clamp(visualAmount, 0f, 1f);

                // Limit by steps
                if (numberOfSteps > 0)
                {
                    visualAmount = Mathf.Round(visualAmount * numberOfSteps) / numberOfSteps;
                }

                amount = (visualAmount * (maxValue - minValue)) + minValue;
            }
            else
            {
                amount = visualAmount;
            }

            switch (sliderType)
            {
            case AC_SliderType.Speech:
                Options.SetSpeechVolume(amount);
                break;

            case AC_SliderType.Music:
                Options.SetMusicVolume(amount);
                break;

            case AC_SliderType.SFX:
                Options.SetSFXVolume(amount);
                break;

            case AC_SliderType.FloatVariable:
                if (varID >= 0)
                {
                    GlobalVariables.SetFloatValue(varID, amount);
                }
                break;

            default:
                break;
            }

            if (!KickStarter.actionListAssetManager.IsListRunning(actionListOnChange))
            {
                AdvGame.RunActionListAsset(actionListOnChange);
            }
        }