public void MODPlayVoiceLS(string filename, int channel, float volume, int character)
        {
            MODTextController.MODCurrentVoiceLayerDetect = channel;
            AudioLayerUnity item = channelDictionary[GetChannelByTypeChannel(AudioType.Voice, channel)];

            if (currentAudio[AudioType.Voice].ContainsKey(channel))
            {
                currentAudio[AudioType.Voice].Remove(channel);
            }
            currentAudio[AudioType.Voice].Add(channel, new AudioInfo(volume, filename));
            if (item.IsPlaying())
            {
                item.StopAudio();
            }
            item.PlayAudio(filename, AudioType.Voice, volume);
            if (MODSystem.instance.modSceneController.MODLipSyncBoolCheck(character))
            {
                GameSystem.Instance.SceneController.MODLipSyncStart(character, channel, filename);
            }
            if (GameSystem.Instance.IsAuto)
            {
                item.OnLoadCallback(delegate
                {
                    GameSystem.Instance.AddWait(new Wait(item.GetRemainingPlayTime(), WaitTypes.WaitForVoice, null));
                });
            }
        }
Esempio n. 2
0
        public void PlayVoice(string filename, int channel, float volume)
        {
            string text = filename.Substring(0, 4);

            if (0 == 0)
            {
                AudioLayerUnity audio = channelDictionary[GetChannelByTypeChannel(AudioType.Voice, channel)];
                if (currentAudio[AudioType.Voice].ContainsKey(channel))
                {
                    currentAudio[AudioType.Voice].Remove(channel);
                }
                currentAudio[AudioType.Voice].Add(channel, new AudioInfo(volume, filename));
                if (audio.IsPlaying())
                {
                    audio.StopAudio();
                }
                audio.PlayAudio(filename, AudioType.Voice, volume);
                if (GameSystem.Instance.IsAuto)
                {
                    audio.OnLoadCallback(delegate
                    {
                        GameSystem.Instance.AddWait(new Wait(audio.GetRemainingPlayTime(), WaitTypes.WaitForVoice, null));
                    });
                }
            }
        }
        public float GetRemainingVoicePlayTime(int channel)
        {
            AudioLayerUnity audioLayerUnity = channelDictionary[GetChannelByTypeChannel(AudioType.Voice, channel)];

            return(audioLayerUnity.GetRemainingPlayTime());
        }
        public void PlayVoice(string filename, int channel, float volume)
        {
            string text = filename.Substring(0, 4);
            bool   flag = false;

            switch (text)
            {
            case "chie":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVChie").BoolValue();
                break;

            case "eiji":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVEiji").BoolValue();
                break;

            case "kana":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVKana").BoolValue();
                break;

            case "kira":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVKira").BoolValue();
                break;

            case "mast":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVMast").BoolValue();
                break;

            case "mura":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVMura").BoolValue();
                break;

            case "riho":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVRiho").BoolValue();
                break;

            case "rmn_":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVRmn_").BoolValue();
                break;

            case "sari":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVSari").BoolValue();
                break;

            case "tika":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVTika").BoolValue();
                break;

            case "yayo":
                flag = BurikoMemory.Instance.GetGlobalFlag("GVYayo").BoolValue();
                break;

            default:
                flag = BurikoMemory.Instance.GetGlobalFlag("GVOther").BoolValue();
                break;
            }
            if (!flag)
            {
                AudioLayerUnity audio = channelDictionary[GetChannelByTypeChannel(AudioType.Voice, channel)];
                if (currentAudio[AudioType.Voice].ContainsKey(channel))
                {
                    currentAudio[AudioType.Voice].Remove(channel);
                }
                currentAudio[AudioType.Voice].Add(channel, new AudioInfo(volume, filename));
                if (audio.IsPlaying())
                {
                    audio.StopAudio();
                }
                audio.PlayAudio(filename, AudioType.Voice, volume);
                if (GameSystem.Instance.IsAuto)
                {
                    audio.OnLoadCallback(delegate
                    {
                        GameSystem.Instance.AddWait(new Wait(audio.GetRemainingPlayTime(), WaitTypes.WaitForVoice, null));
                    });
                }
            }
        }