private void ShowNextDialog()
 {
     this._dialogIndex++;
     if (this._currentChatCoroutine != null)
     {
         Singleton <LevelManager> .Instance.levelEntity.StopCoroutine(this._currentChatCoroutine);
     }
     if ((this._dialogIndex >= 0) && (this._dialogIndex < this._dialogList.Count))
     {
         DialogMetaData dialogMetaData = this._dialogList[this._dialogIndex];
         this._currentDialogDataItem = new DialogDataItem(dialogMetaData);
         int avatarID = dialogMetaData.avatarID;
         MonoStoryScreen.SelectScreenSide screenSide = (MonoStoryScreen.SelectScreenSide)dialogMetaData.screenSide;
         this._storyScreen.RefreshAvatar3dModel(avatarID, screenSide);
         this._storyScreen.RefreshCurrentSpeakerWidgets(this._currentDialogDataItem);
         this._currentChatIndex = 0;
         if (this._currentDialogDataItem.plotChatNodeList.Count > 1)
         {
             this._currentChatCoroutine = Singleton <LevelManager> .Instance.levelEntity.StartCoroutine(this.WaitAllChatsDone());
         }
         else
         {
             this.RefreshChatMsg(this._currentDialogDataItem.plotChatNodeList[this._currentChatIndex].chatContent, this._currentDialogDataItem.plotChatNodeList[this._currentChatIndex].chatDuration);
             this._storyScreen.StoryDialogState = MonoStoryScreen.DialogState.Displaying;
             this._currentChatIndex++;
         }
         Singleton <WwiseAudioManager> .Instance.Post(this._currentDialogDataItem.audio, null, null, null);
     }
     else
     {
         this.QuitPlot();
     }
 }
Exemple #2
0
        public static void LoadFromFile()
        {
            List <string> list = new List <string>();

            char[]   separator = new char[] { "\n"[0] };
            string[] strArray  = CommonUtils.LoadTextFileToString("Data/_ExcelOutput/DialogData").Split(separator);
            for (int i = 0; i < strArray.Length; i++)
            {
                if (strArray[i].Length >= 1)
                {
                    list.Add(strArray[i]);
                }
            }
            int capacity = list.Count - 1;

            _itemDict = new Dictionary <int, DialogMetaData>();
            _itemList = new List <DialogMetaData>(capacity);
            for (int j = 1; j <= capacity; j++)
            {
                char[]   chArray2  = new char[] { "\t"[0] };
                string[] strArray2 = list[j].Split(chArray2);
                List <DialogMetaData.PlotChatNode> content = new List <DialogMetaData.PlotChatNode>();
                foreach (string str2 in CommonUtils.GetStringListFromString(strArray2[4], null))
                {
                    content.Add(new DialogMetaData.PlotChatNode(str2));
                }
                DialogMetaData item = new DialogMetaData(int.Parse(strArray2[0]), int.Parse(strArray2[1]), int.Parse(strArray2[2]), strArray2[3].Trim(), content, strArray2[5].Trim());
                if (!_itemDict.ContainsKey(item.dialogID))
                {
                    _itemList.Add(item);
                    _itemDict.Add(item.dialogID, item);
                }
            }
        }
        private void ReadPlotData()
        {
            PlotMetaData plotMetaDataByKey = PlotMetaDataReader.GetPlotMetaDataByKey(this._plotID);

            this._plotData = plotMetaDataByKey;
            for (int i = plotMetaDataByKey.startDialogID; i <= plotMetaDataByKey.endDialogID; i++)
            {
                DialogMetaData dialogMetaDataByKey = DialogMetaDataReader.GetDialogMetaDataByKey(i);
                this._dialogList.Add(dialogMetaDataByKey);
            }
        }
Exemple #4
0
 public DialogDataItem(DialogMetaData dialogMetaData)
 {
     this.dialogID = dialogMetaData.dialogID;
     this.avatarID = dialogMetaData.avatarID;
     if (dialogMetaData.screenSide == 0)
     {
         this.screenSide = MonoStoryScreen.SelectScreenSide.Left;
     }
     else if (dialogMetaData.screenSide == 1)
     {
         this.screenSide = MonoStoryScreen.SelectScreenSide.Right;
     }
     else
     {
         this.screenSide = MonoStoryScreen.SelectScreenSide.None;
     }
     this.source           = dialogMetaData.source;
     this.plotChatNodeList = dialogMetaData.content;
     this.audio            = dialogMetaData.audio;
 }