public void InitList()
        {
            for (int index = 0; index < this.transformRoot.get_childCount(); ++index)
            {
                Object.Destroy((Object)((Component)this.transformRoot.GetChild(index)).get_gameObject());
            }
            this.transformRoot.DetachChildren();
            this.select = -1;
            this.listNode.Clear();
            foreach (VoiceCtrl.VoiceInfo voiceInfo1 in this.m_OCIChar.voiceCtrl.list)
            {
                Info.LoadCommonInfo voiceInfo2 = Singleton <Info> .Instance.GetVoiceInfo(voiceInfo1.group, voiceInfo1.category, voiceInfo1.no);

                if (voiceInfo2 == null)
                {
                    Debug.Log((object)string.Format("情報が取れない G[{0}] : C[{1}] : N[{2}]", (object)voiceInfo1.group, (object)voiceInfo1.category, (object)voiceInfo1.no));
                }
                else
                {
                    this.AddNode(voiceInfo2.name);
                }
            }
            this.scrollRect.set_verticalNormalizedPosition(1f);
            ((Behaviour)this.imagePlayNow).set_enabled(this.m_OCIChar != null && this.m_OCIChar.voiceCtrl.isPlay);
            ((Selectable)this.buttonRepeat).get_image().set_sprite(this.spriteRepeat[(int)this.m_OCIChar.voiceRepeat]);
            this.voiceRegistrationList.ociChar = this.m_OCIChar;
        }
Example #2
0
        public void Play(int _no)
        {
            this.m_No = _no;
            if (!this.m_Play)
            {
                return;
            }
            Info.LoadCommonInfo loadCommonInfo = (Info.LoadCommonInfo)null;
            if (!Singleton <Info> .Instance.dicBGMLoadInfo.TryGetValue(this.m_No, out loadCommonInfo))
            {
                return;
            }
            if (Singleton <Studio.Studio> .Instance.outsideSoundCtrl.play)
            {
                Singleton <Studio.Studio> .Instance.outsideSoundCtrl.Stop();
            }
            Transform transform = Singleton <Sound> .Instance.Play(Sound.Type.BGM, loadCommonInfo.bundlePath, loadCommonInfo.fileName, 0.0f, 0.0f, true, false, -1, true);

            if (Object.op_Equality((Object)transform, (Object)null))
            {
                return;
            }
            this.audioSource = (AudioSource)((Component)transform).GetComponent <AudioSource>();
            this.audioSource.set_loop(this.repeat == BGMCtrl.Repeat.All);
            this.isPause = false;
        }
Example #3
0
        private Info.LoadCommonInfo GetLoadInfo(int _group, int _category, int _no)
        {
            Dictionary <int, Dictionary <int, Info.LoadCommonInfo> > dictionary1 = (Dictionary <int, Dictionary <int, Info.LoadCommonInfo> >)null;

            if (!Singleton <Info> .Instance.dicVoiceLoadInfo.TryGetValue(_group, out dictionary1))
            {
                return((Info.LoadCommonInfo)null);
            }
            Dictionary <int, Info.LoadCommonInfo> dictionary2 = (Dictionary <int, Info.LoadCommonInfo>)null;

            if (!dictionary1.TryGetValue(_category, out dictionary2))
            {
                return((Info.LoadCommonInfo)null);
            }
            Info.LoadCommonInfo loadCommonInfo = (Info.LoadCommonInfo)null;
            return(!dictionary2.TryGetValue(_no, out loadCommonInfo) ? (Info.LoadCommonInfo)null : loadCommonInfo);
        }
Example #4
0
        public bool Play(int _idx)
        {
            if (!Singleton <Info> .IsInstance() || this.list.Count == 0)
            {
                return(false);
            }
            if (!MathfEx.RangeEqualOn <int>(0, _idx, this.list.Count - 1))
            {
                this.index = -1;
                return(false);
            }
            this.Stop();
            VoiceCtrl.VoiceInfo voiceInfo = this.list[_idx];
            Info.LoadCommonInfo loadInfo  = this.GetLoadInfo(voiceInfo.group, voiceInfo.category, voiceInfo.no);
            if (loadInfo == null)
            {
                return(false);
            }
            Manager.Voice instance        = Singleton <Manager.Voice> .Instance;
            int           personality     = this.personality;
            string        bundlePath      = loadInfo.bundlePath;
            string        fileName        = loadInfo.fileName;
            float         pitch           = this.pitch;
            Transform     transHead       = this.transHead;
            int           no              = personality;
            string        assetBundleName = bundlePath;
            string        assetName       = fileName;
            double        num             = (double)pitch;
            Transform     voiceTrans      = transHead;

            this.transVoice = instance.Play(no, assetBundleName, assetName, (float)num, 0.0f, 0.0f, true, voiceTrans, Manager.Voice.Type.PCM, -1, true, true, false);
            if (Object.op_Equality((Object)this.transVoice, (Object)null))
            {
                return(false);
            }
            this.index                      = _idx;
            this.voiceEndChecker            = (VoiceEndChecker)((Component)this.transVoice).get_gameObject().AddComponent <VoiceEndChecker>();
            this.voiceEndChecker.onEndFunc += new VoiceEndChecker.OnEndFunc(this.NextVoicePlay);
            this.ociChar.SetVoice();
            return(true);
        }
Example #5
0
        public void Play(int _no)
        {
            this.m_No = _no;
            if (!this.m_Play)
            {
                return;
            }
            Info.LoadCommonInfo loadCommonInfo = (Info.LoadCommonInfo)null;
            if (!Singleton <Info> .Instance.dicENVLoadInfo.TryGetValue(this.m_No, out loadCommonInfo))
            {
                return;
            }
            Singleton <Sound> .Instance.Stop(Sound.Type.ENV);

            Transform transform = Singleton <Sound> .Instance.Play(Sound.Type.ENV, loadCommonInfo.bundlePath, loadCommonInfo.fileName, 0.0f, 0.0f, true, true, -1, true);

            if (Object.op_Equality((Object)transform, (Object)null))
            {
                return;
            }
            this.audioSource = (AudioSource)((Component)transform).GetComponent <AudioSource>();
            this.audioSource.set_loop(this.repeat == BGMCtrl.Repeat.All);
            this.audioSource.set_spatialBlend(0.0f);
        }
Example #6
0
        //Voice

        private void LoadVoice()
        {
            Dictionary <int, Dictionary <int, Dictionary <int, Info.LoadCommonInfo> > > dicInfo;
            Dictionary <string, List <string[]> > dicArgs;
            int    index;
            string pattern;

            dicInfo = info.dicVoiceLoadInfo;
            pattern = fileSuffixVoice;

            dicArgs = dicAllFileArgs[pattern];
            if (dicArgs == null)
            {
                return;
            }

            foreach (string fileName in dicArgs.Keys)
            {
                // 00_00_00 のはず。
                //または、各行からの方が良いか? <- でも無駄が多くなる?
                string[] ss = fileName.Replace(pattern, "").Split(new string[] { "_" }, 0);

                if (int.TryParse(ss[0], out int baseIndex) && int.TryParse(ss[1], out int catIndex))
                {
                    index = baseIndex + groupOffset;

                    foreach (string[] args in dicArgs[fileName])
                    {
                        //ボイスの場合、グループもカテゴリーもインデックスがなければ追加
                        if (int.TryParse(args[0], out int clipIndex))
                        {
                            if (!dicInfo.ContainsKey(index))
                            {
                                dicInfo.Add(index, new Dictionary <int, Dictionary <int, Info.LoadCommonInfo> >());
                            }
                            if (!dicInfo[index].ContainsKey(catIndex))
                            {
                                dicInfo[index].Add(catIndex, new Dictionary <int, Info.LoadCommonInfo>());
                            }

                            //ボイス情報入れる
                            //<0管理番号><1大きい項目><2中間項目><3表示名><4バンドルパス><5ファイル名>

                            Info.LoadCommonInfo voiceInfo = null;

                            try
                            {
                                voiceInfo = new Info.LoadCommonInfo()
                                {
                                    name       = args[3],
                                    bundlePath = extDir + args[4],
                                    fileName   = args[5],
                                };
                            }
                            catch
                            {
                                voiceInfo = null;
                            }

                            if (dicInfo[index][catIndex].ContainsKey(clipIndex))
                            {
                                if (force)
                                {
                                    dicInfo[index][catIndex][clipIndex] = voiceInfo;
                                }
                            }
                            else
                            {
                                dicInfo[index][catIndex].Add(clipIndex, voiceInfo);
                            }
                        }
                    }
                }
            }
        }
Example #7
0
        private void LoadVoice()
        {
            Dictionary <int, Dictionary <int, Dictionary <int, Info.LoadCommonInfo> > > dicVoiceLoadInfo = info.dicVoiceLoadInfo;
            string text = "Voice_";

            Dictionary <string, List <string[]> > dictionary = dicAllFileArgs[text];

            if (dictionary == null)
            {
                return;
            }

            foreach (string text2 in dictionary.Keys)
            {
                string[] array = text2.Replace(text, "").Split(new string[] { "_" }, StringSplitOptions.None);

                if (int.TryParse(array[0], out int num) && int.TryParse(array[1], out int key))
                {
                    int key2 = num + groupOffset;
                    foreach (string[] array2 in dictionary[text2])
                    {
                        if (int.TryParse(array2[0], out int key3))
                        {
                            if (!dicVoiceLoadInfo.ContainsKey(key2))
                            {
                                dicVoiceLoadInfo.Add(key2, new Dictionary <int, Dictionary <int, Info.LoadCommonInfo> >());
                            }

                            if (!dicVoiceLoadInfo[key2].ContainsKey(key))
                            {
                                dicVoiceLoadInfo[key2].Add(key, new Dictionary <int, Info.LoadCommonInfo>());
                            }

                            Info.LoadCommonInfo value = null;
                            try
                            {
                                value = new Info.LoadCommonInfo
                                {
                                    name       = array2[3],
                                    bundlePath = Path.Combine(extDir, array2[4]),
                                    fileName   = array2[5]
                                };
                            }
                            catch
                            {
                                value = null;
                            }

                            if (dicVoiceLoadInfo[key2][key].ContainsKey(key3))
                            {
                                if (force)
                                {
                                    dicVoiceLoadInfo[key2][key][key3] = value;
                                }
                            }
                            else
                            {
                                dicVoiceLoadInfo[key2][key].Add(key3, value);
                            }
                        }
                    }
                }
            }
        }