Пример #1
0
        protected override void Awake()
        {
            if (!this.CheckInstance())
            {
                return;
            }
            Object.DontDestroyOnLoad((Object)((Component)this).get_gameObject());
            this.rootSetting = new GameObject("SettingObjectPCM").get_transform();
            this.rootSetting.SetParent(((Component)this).get_transform(), false);
            this.rootPlay = new GameObject("PlayObjectPCM").get_transform();
            this.rootPlay.SetParent(((Component)this).get_transform(), false);
            this.settingObjects = new GameObject[Illusion.Utils.Enum <Voice.Type> .Length];
            for (int index = 0; index < this.settingObjects.Length; ++index)
            {
                this.LoadSetting((Voice.Type)index, -1);
            }
            this.dicASCache  = new Dictionary <int, Dictionary <string, AudioSource> >();
            this.ASCacheRoot = new GameObject("AudioSourceCache").get_transform();
            this.ASCacheRoot.SetParent(this.rootPlay, false);
            string str1 = AssetBundleManager.BaseDownloadingURL + "sound/data/pcm/";
            List <VoiceInfo.Param> sortList      = new List <VoiceInfo.Param>();
            HashSet <int>          distinctCheck = new HashSet <int>();

            CommonLib.GetAssetBundleNameListFromPath("etcetra/list/config/", true).ForEach((Action <string>)(file =>
            {
                foreach (List <VoiceInfo.Param> source in ((IEnumerable <VoiceInfo>)AssetBundleManager.LoadAllAsset(file, typeof(VoiceInfo), (string)null).GetAllAssets <VoiceInfo>()).Select <VoiceInfo, List <VoiceInfo.Param> >((Func <VoiceInfo, List <VoiceInfo.Param> >)(p => p.param)))
                {
                    foreach (VoiceInfo.Param obj in source.Where <VoiceInfo.Param>((Func <VoiceInfo.Param, bool>)(p => !distinctCheck.Add(p.No))))
                    {
                        VoiceInfo.Param p = obj;
                        Debug.LogWarning((object)("Remove Voice No:" + (object)p.No));
                        sortList.Remove(sortList.FirstOrDefault <VoiceInfo.Param>((Func <VoiceInfo.Param, bool>)(l => l.No == p.No)));
                    }
                    sortList.AddRange((IEnumerable <VoiceInfo.Param>)source);
                }
                AssetBundleManager.UnloadAssetBundle(file, false, (string)null, false);
            }));
            sortList.Sort((Comparison <VoiceInfo.Param>)((a, b) => a.Sort.CompareTo(b.Sort)));
            this.voiceInfoList = sortList;
            Dictionary <int, string> dic = new Dictionary <int, string>();

            this.voiceInfoList.ForEach((Action <VoiceInfo.Param>)(p =>
            {
                string str2 = string.Format("c{0}", (object)p.No.MinusThroughToString("00"));
                dic.Add(p.No, str2);
                Transform transform = new GameObject(str2).get_transform();
                transform.SetParent(this.rootPlay, false);
                this.voiceDic.Add(p.No, transform);
            }));
            this._Config = new VoiceSystem("Volume", dic);
            this.xmlCtrl = new Control("config", "voice.xml", nameof(Voice), new Illusion.Elements.Xml.Data[1]
            {
                (Illusion.Elements.Xml.Data) this._Config
            });
            this.Load();
        }
Пример #2
0
 protected override string GetPersonalityNameLocalization(VoiceInfo.Param voiceInfo)
 {
     return(voiceInfo.Get(Localize.Translate.Manager.Language));
 }
 protected virtual string GetPersonalityNameLocalization(VoiceInfo.Param voiceInfo)
 {
     return(voiceInfo.Personality);
 }