Esempio n. 1
0
        private void PushCharacters(string s, EventDialogBubble.Ctx ctx)
        {
            float num = this.mNumCharacters <= 0 ? 0.0f : this.mCharacters[this.mNumCharacters - 1].TimeOffset;

            for (int index = 0; index < s.Length; ++index)
            {
                float interval = ctx.Interval;
                if (s[index] == '\n')
                {
                    interval = this.NewLineInterval;
                }
                this.mCharacters[this.mNumCharacters] = new EventDialogBubble.Character(s[index], ctx.Color, interval, num + interval);
                num = this.mCharacters[this.mNumCharacters].TimeOffset;
                ++this.mNumCharacters;
            }
        }
Esempio n. 2
0
 private void Parse(EventDialogBubble.Element[] c, ref int n, string end, EventDialogBubble.Ctx ctx)
 {
     while (n < c.Length)
     {
         if (!string.IsNullOrEmpty(c[n].Tag))
         {
             Match match1;
             if ((match1 = EventDialogBubble.regEndTag.Match(c[n].Tag)).Success)
             {
                 if (match1.Groups[1].Value == end)
                 {
                     ++n;
                     break;
                 }
                 ++n;
             }
             else
             {
                 Match match2;
                 if ((match2 = EventDialogBubble.regColor.Match(c[n].Tag)).Success)
                 {
                     ++n;
                     Color32 color = ctx.Color;
                     ctx.Color = ColorUtility.ParseColor(match2.Groups[1].Value);
                     this.Parse(c, ref n, "color", ctx);
                     ctx.Color = color;
                 }
                 else
                 {
                     ++n;
                 }
             }
         }
         else
         {
             this.PushCharacters(c[n].Value, ctx);
             ++n;
         }
     }
 }
Esempio n. 3
0
        private void FlushText()
        {
            string mTextQueue = this.mTextQueue;

            this.mTextQueue = (string)null;
            if (this.mCharacters == null || this.mCharacters.Length < mTextQueue.Length)
            {
                this.mCharacters = new EventDialogBubble.Character[mTextQueue.Length * 2];
            }
            string s = mTextQueue.Replace("<br>", "\n");

            EventAction_Dialog.TextSpeedTypes speed = EventAction_Dialog.TextSpeedTypes.Normal;
            int n = 0;

            EventDialogBubble.Ctx ctx = new EventDialogBubble.Ctx();
            ctx.Interval        = speed.ToFloat();
            ctx.Color           = Color32.op_Implicit(!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BodyText, (UnityEngine.Object)null) ? Color.get_black() : ((Graphic)this.BodyText).get_color());
            this.mNumCharacters = 0;
            this.Parse(EventDialogBubble.SplitTags(s), ref n, (string)null, ctx);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BodyText, (UnityEngine.Object)null))
            {
                this.BodyText.set_text(string.Empty);
            }
            this.mStartTime       = Time.get_time() + this.FadeInTime;
            this.mTextNeedsUpdate = this.mNumCharacters > 0;
            this.mFadingOut       = false;
            this.mCurrentEmotion  = this.Emotion;
            if (string.IsNullOrEmpty(this.VoiceSheetName) || string.IsNullOrEmpty(this.VoiceCueName))
            {
                this.FadeOutVoice();
            }
            else
            {
                this.mVoice = new MySound.Voice(this.VoiceSheetName, (string)null, (string)null, EventAction.IsUnManagedAssets(this.VoiceSheetName, false));
                this.mVoice.Play(this.VoiceCueName, 0.0f, false);
                this.VoiceCueName = (string)null;
            }
        }