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)
33 Debug.LogError(
"idTopic not found:" + idTopic);
36 string text = dictionary.TryGetValue(
id);
41 Debug.LogError(
"id not found:" +
id);
44 text = dictionary.TryGetValue(
"default");
47 text = text.Split(
new string[3] {
"\r\n",
"\r",
"\n" }, StringSplitOptions.None).RandomItem();
50 if (flag && !text.IsEmpty() && !text.StartsWith(
"(") && !text.StartsWith(
"*"))
52 text =
"(" + text +
")";
54 text = text.Replace(
"。)",
")");
61 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)