Unity编辑器报错
KeyNotFoundException: Cannot find Delegate Adapter for:scienceTree/<>c__DisplayClass15_0.<click>b__1(KeyValuePair`2 q), Please add following code:
appdomain.DelegateManager.RegisterFunctionDelegate<System.Collections.Generic.KeyValuePair<ILRuntime.Runtime.Intepreter.ILTypeInstance, FairyGUI.GButton>, System.Boolean>();
参考资料1
由于Dictionary<T,T1>太过灵活,T什么类型的类都可以,通过FirstOrDefault减少冗余代码。
但是FirstOrDefault在热更新中得注册。
...
using FairyGUI;
using System.Linq;//FirstOrDefault
...
if (dict.ContainsValue(gb))
{
Debug.Log("click item3:" + gb.id + "/name:" + gb.name + "/");
//dict.
//var keys = dict.Where(q => q.Value == gb).Select(q => q.Key);
var firstKey = dict.FirstOrDefault(q => q.Valu