Пример #1
0
        public static Command Analysis(ScenarioManager.Line line)
        {
            var command = new Command();

            // コマンド出現行を記録
            command.line = line.LineCount;

            // コマンド名を取得
            var tag    = Regex.Match(line.Text, @"\[.*]");
            var tagstr = tag.Groups[0].ToString();

            command.tag = AnalysisTag(tagstr);
            //Debug.Log(tagstr);

            // コマンドのパラメータを取得
            Regex regex   = new Regex("(\\S+)=(\\S+)");
            var   matches = regex.Matches(tagstr);

            command.param = new Dictionary <string, string>();
            //Debug.Log(matches.Count);
            foreach (Match match in matches)
            {
                //Debug.LogFormat("{0},{1}", match.Groups[1].ToString(), match.Groups[2].ToString().TrimEnd(' ', ']'));
                command.param.Add(match.Groups[1].ToString(), match.Groups[2].ToString().TrimEnd(' ', ']'));
            }
            return(command);
        }
 public void TextUpdate(ScenarioManager.Line line)
 {
     switch (line.Type)
     {
     case ScenarioManager.LineType.NormalText:
     case ScenarioManager.LineType.WaitText:
         string t = text.text;
         t        += line.Text;
         text.text = t;
         break;
     }
     CurrentLine++;
 }