Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        public static Transform Play(Manager.Voice voice, Voice.Setting s)
        {
            Manager.Voice voice1           = voice;
            int           no1              = s.no;
            string        assetBundleName1 = s.assetBundleName;
            string        assetName1       = s.assetName;
            float         pitch            = s.pitch;
            float         delayTime        = s.delayTime;
            bool          isAsync          = s.isAsync;
            int           no2              = no1;
            string        assetBundleName2 = assetBundleName1;
            string        assetName2       = assetName1;
            double        num1             = (double)pitch;
            double        num2             = (double)delayTime;
            int           num3             = isAsync ? 1 : 0;
            Transform     voiceTrans       = s.voiceTrans;
            int           type             = (int)s.type;
            int           settingNo        = s.settingNo;
            int           num4             = s.isPlayEndDelete ? 1 : 0;
            int           num5             = s.isBundleUnload ? 1 : 0;

            return(voice1.Play(no2, assetBundleName2, assetName2, (float)num1, (float)num2, 0.0f, num3 != 0, voiceTrans, (Manager.Voice.Type)type, settingNo, num4 != 0, num5 != 0, false));
        }