2using System.Collections.Generic;
7 public List<string>
IDs;
13 IDs =
new List<string>();
14 foreach (
string key
in list[0].Keys)
16 if (key !=
"id" && key !=
"path")
23 public string GetTalk(
string id,
string idTopic,
bool useDefault =
false,
bool human =
true)
30 Dictionary<string, string> dictionary =
all.TryGetValue(idTopic);
31 if (dictionary ==
null)
35 string text = dictionary.TryGetValue(
id);
40 Debug.LogError(
"id not found:" +
id);
43 text = dictionary.TryGetValue(
"default");
46 text = text.Split(
new string[3] {
"\r\n",
"\r",
"\n" }, StringSplitOptions.None).RandomItem();
49 if (flag && !text.IsEmpty() && !text.StartsWith(
"(") && !text.StartsWith(
"*"))
51 text =
"(" + text +
")";
53 text = text.Replace(
"。)",
")");
60 return IDs.RandomItem();
Dictionary< string, Dictionary< string, string > > all
List< Dictionary< string, string > > list
virtual void Initialize()
override void OnInitialize()
string GetTalk(string id, string idTopic, bool useDefault=false, bool human=true)
string GetRandomID(string tag)