【发布时间】:2020-04-14 02:18:32
【问题描述】:
我有一个具有相同名称的类的 firebasesript.cs 文件,在开始时我检索了 firebase 文档。对于检索到的每个试图让 main.cs 得到通知的文档。
在 firebasescript 中有
public delegate void LoadDoc();
public static event LoadDoc onLoadDoc;
主要有
void Start()
{
firebasescript.onLoadDoc += DocLoaded;
}
void DocLoaded()
{
Debug.Log("loaded");
}
只是不知道如何在 firebasescript 中触发事件:
foreach (DocumentSnapshot documentSnapshot in capitalQuerySnapshot.Documents) {
Debug.Log(String.Format("Document data for {0} document:", documentSnapshot.Id));
Dictionary<string, object> city = documentSnapshot.ToDictionary();
foreach (KeyValuePair<string, object> pair in city) {
**//here is where i want the notification to happen**
Debug.Log(String.Format("{0}: {1}", pair.Key, pair.Value));
}
};
});
如果有更好的方法可以做到这一点,请接受所有建议。 谢谢。
【问题讨论】: