Example #1
0
        private void Start()
        {
            UnitData data = !string.IsNullOrEmpty(this.DebugUnitID) ? MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUnitID(this.DebugUnitID) : MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);

            string skinVoiceSheetName = data.GetUnitSkinVoiceSheetName(-1);
            string sheetName          = "VO_" + skinVoiceSheetName;
            string cueNamePrefix      = data.GetUnitSkinVoiceCueName(-1) + "_";

            this.mUnitVoice = new MySound.Voice(sheetName, skinVoiceSheetName, cueNamePrefix, false);
            this.PlayProfileVoice();
            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), data);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            if (data == null)
            {
                return;
            }
            for (int index = 0; index < this.ProfileTexts.Length; ++index)
            {
                if (!Object.op_Equality((Object)this.ProfileTexts[index], (Object)null) && !string.IsNullOrEmpty(this.ProfileTexts[index].get_text()))
                {
                    StringBuilder stringBuilder = GameUtility.GetStringBuilder();
                    stringBuilder.Append("unit.");
                    stringBuilder.Append(data.UnitParam.iname);
                    stringBuilder.Append("_");
                    stringBuilder.Append(this.ProfileTexts[index].get_text());
                    this.ProfileTexts[index].set_text(LocalizedText.Get(stringBuilder.ToString()));
                }
            }
        }
Example #2
0
 private void OnDestroy()
 {
     if (this.mUnitVoice != null)
     {
         this.mUnitVoice.StopAll(0.0f);
     }
     this.mUnitVoice = (MySound.Voice)null;
 }
Example #3
0
 public void StopVoice()
 {
     if (this.mVoice == null)
     {
         return;
     }
     this.mVoice.StopAll(0.0f);
     this.mVoice = (MySound.Voice)null;
 }
Example #4
0
 public void Discard()
 {
     if (this.mVoice != null)
     {
         this.mVoice.Cleanup();
     }
     this.mVoice    = (MySound.Voice)null;
     this.mCharName = (string)null;
 }
 public override void OnActivate(int pinID)
 {
     MySound.Voice voice = new MySound.Voice(this.charaName);
     if (voice != null)
     {
         voice.Play(this.cueID, 0.0f);
     }
     this.ActivateOutputLinks(1);
 }
Example #6
0
 private void FadeOutVoice()
 {
     if (this.mVoice == null)
     {
         return;
     }
     this.mVoice.StopAll(this.VoiceFadeOutSec);
     this.mVoice.Cleanup();
     this.mVoice = (MySound.Voice)null;
 }
Example #7
0
 private void Awake()
 {
     if (string.IsNullOrEmpty(this.DirectCharName))
     {
         this.DirectCharName = "uroboros";
     }
     this.mVoice    = new MySound.Voice(this.DirectCharName);
     this.excites   = 0;
     this.mCharName = this.DirectCharName;
 }
        private void FlushText()
        {
            string mTextQueue = this.mTextQueue;

            this.mTextQueue = (string)null;
            if (this.mCharacters == null || this.mCharacters.Length < mTextQueue.Length)
            {
                this.mCharacters = new EventDialogBubbleCustom.Character[mTextQueue.Length * 2];
            }
            string str      = "REPLACE_PLAYER_NAME";
            string newValue = string.Empty;

            if (Object.op_Inequality((Object)MonoSingleton <GameManager> .GetInstanceDirect(), (Object)null))
            {
                newValue = MonoSingleton <GameManager> .GetInstanceDirect().Player.Name;
            }
            string s = mTextQueue.Replace("<p_name>", str).Replace("<br>", "\n");

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

            EventDialogBubbleCustom.Ctx ctx = new EventDialogBubbleCustom.Ctx();
            ctx.Interval        = speed.ToFloat();
            ctx.Color           = Color32.op_Implicit(!Object.op_Inequality((Object)this.BodyText, (Object)null) ? Color.get_black() : ((Graphic)this.BodyText).get_color());
            this.mNumCharacters = 0;
            EventDialogBubbleCustom.Element[] c = EventDialogBubbleCustom.SplitTags(s);
            for (int index = 0; index < c.Length; ++index)
            {
                if (c[index] != null)
                {
                    c[index].Value = c[index].Value.Replace(str, newValue);
                }
            }
            this.Parse(c, ref n, (string)null, ctx);
            if (Object.op_Inequality((Object)this.BodyText, (Object)null))
            {
                this.BodyText.set_text(string.Empty);
            }
            this.mStartTime       = Time.get_time() + this.FadeInTime;
            this.mTextNeedsUpdate = this.mNumCharacters > 0;
            this.mFadingOut       = false;
            if (string.IsNullOrEmpty(this.VoiceSheetName) || string.IsNullOrEmpty(this.VoiceCueName))
            {
                this.FadeOutVoice();
            }
            else
            {
                this.mVoice = new MySound.Voice(this.VoiceSheetName, (string)null, (string)null);
                this.mVoice.Play(this.VoiceCueName, 0.0f);
                this.VoiceCueName = (string)null;
            }
        }
Example #9
0
        private bool PlayVoice()
        {
            bool flag = false;

            if (!string.IsNullOrEmpty(this.m_VoiceName))
            {
                string[] strArray = this.m_VoiceName.Split('.');
                if (strArray.Length == 2)
                {
                    string sheetName = strArray[0];
                    string cueID     = strArray[1];
                    this.m_Voice = new MySound.Voice(sheetName, (string)null, (string)null, false);
                    this.m_Voice.Play(cueID, 0.0f, false);
                    flag = true;
                }
            }
            return(flag);
        }
Example #10
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;
            }
        }
Example #11
0
 public bool SetCharName(string directName, string sheetName, string cueName)
 {
     if (this.CharType == UnitVoice.ECharType.BATTLE_SKILL)
     {
         SceneBattle instance   = SceneBattle.Instance;
         BattleCore  battleCore = !Object.op_Equality((Object)instance, (Object)null) ? instance.Battle : (BattleCore)null;
         Unit        unit       = battleCore != null ? battleCore.CurrentUnit : (Unit)null;
         if (unit != null)
         {
             sheetName = unit.GetUnitSkinVoiceSheetName(-1);
             cueName   = unit.GetUnitSkinVoiceCueName(-1);
             if (string.IsNullOrEmpty(sheetName) || this.mVoice != null && cueName.Equals(this.mCharName))
             {
                 return(false);
             }
             this.mCharName = cueName;
             this.mVoice    = new MySound.Voice("VO_" + sheetName, sheetName, cueName + "_");
             this.SetupCueName();
             return(true);
         }
         this.mVoice    = (MySound.Voice)null;
         this.mCharName = (string)null;
         return(false);
     }
     if (this.CharType == UnitVoice.ECharType.BATTLE_SKILL_COLLABO)
     {
         this.mVoice    = (MySound.Voice)null;
         this.mCharName = (string)null;
         SceneBattle instance = SceneBattle.Instance;
         Unit        unit     = instance.CollaboMainUnit;
         if (this.CollaboType == UnitVoice.eCollaboType.SUB)
         {
             unit = instance.CollaboSubUnit;
         }
         if (unit == null)
         {
             return(false);
         }
         sheetName = unit.GetUnitSkinVoiceSheetName(-1);
         cueName   = unit.GetUnitSkinVoiceCueName(-1);
         if (string.IsNullOrEmpty(sheetName) || this.mVoice != null && cueName.Equals(this.mCharName))
         {
             return(false);
         }
         this.mCharName = cueName;
         this.mVoice    = new MySound.Voice("VO_" + sheetName, sheetName, cueName + "_");
         this.SetupCueName();
         return(true);
     }
     if (!string.IsNullOrEmpty(sheetName) && !string.IsNullOrEmpty(cueName))
     {
         if (this.mVoice != null && cueName.Equals(this.mCharName))
         {
             return(false);
         }
         this.mCharName = cueName;
         this.mVoice    = new MySound.Voice("VO_" + sheetName, sheetName, cueName + "_");
         this.SetupCueName();
         return(true);
     }
     if (!string.IsNullOrEmpty(directName))
     {
         if (this.mVoice != null && directName.Equals(this.mCharName))
         {
             return(false);
         }
         this.mCharName = directName;
         this.mVoice    = new MySound.Voice(this.mCharName);
         this.SetupCueName();
         return(true);
     }
     this.mVoice    = (MySound.Voice)null;
     this.mCharName = (string)null;
     return(false);
 }
Example #12
0
 protected override void Awake()
 {
     base.Awake();
     this.mVoice = new MySound.Voice("uroboros");
 }
    public override void OnActivate(int pinID)
    {
        switch (pinID)
        {
        case 100:
            FlowNode_ShopVoice2.sType       = this.Type;
            FlowNode_ShopVoice2.sDelayCueID = (string)null;
            this.ActivateOutputLinks(1);
            break;

        case 200:
            this.ActivateOutputLinks(this.Type != FlowNode_ShopVoice2.sType ? 5 : 4);
            break;

        case 500:
            this.ActivateOutputLinks(!MySound.Voice.IsCueSheetPlaying(FlowNode_ShopVoice2.sType.ToString()) ? 5 : 4);
            break;

        case 2001:
            this.mWaitingForPlayEnd   = true;
            this.mWaitSecAfterPlayEnd = this.WaitSecAfterPlayEnd;
            break;

        case 2002:
        case 2003:
            this.DisableIdleVoice(pinID == 2002);
            this.ActivateOutputLinks(1);
            break;

        case 2004:
            MySound.Voice.StopAll(FlowNode_ShopVoice2.sType.ToString(), this.StopSec, false);
            break;

        default:
            if (this.mVoice == null)
            {
                this.mType  = FlowNode_ShopVoice2.sType;
                this.mVoice = new MySound.Voice(this.mType.ToString());
            }
            string cueID    = (string)null;
            bool   direct   = false;
            float  stopSec  = this.StopSec;
            bool   exitPlay = this.ExitCueID;
            switch (pinID)
            {
            case 1000:
                cueID = this.mType != FlowNode_ShopVoice2.EType.shop ? "action_0007" : "action_0013";
                break;

            case 1001:
                cueID    = this.mType != FlowNode_ShopVoice2.EType.shop ? "action_0008" : "action_0014";
                exitPlay = true;
                break;

            case 1002:
                int hour = TimeManager.ServerTime.Hour;
                cueID = hour > 3 ? (hour > 7 ? (hour > 11 ? (hour > 15 ? (hour > 19 ? "time_0023" : "time_0022") : "time_0021") : "time_0020") : "time_0019") : "time_0024";
                break;

            case 1003:
                cueID = FlowNode_ShopVoice2.GetEventCueID(this.mType, TimeManager.ServerTime, this.DateEventFileName);
                break;

            case 2000:
                cueID  = this.CueID;
                direct = this.DirectCueID;
                break;
            }
            this.ActivateOutputLinks(!this.Play(cueID, direct, stopSec, exitPlay) ? 3 : 2);
            this.ActivateOutputLinks(1);
            break;
        }
    }