浏览代码

Better Catching when invoking message delegates

/main
Thomas ICHÉ 6 年前
当前提交
bac6866b
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 11
      Runtime/Messager/Messager.cs

11
Runtime/Messager/Messager.cs


m_RegisteredEvents = new Dictionary<string, Action>();
}
public static void RegisterEvent(string eventName, Action action)
{
if (!m_RegisteredEvents.ContainsKey(eventName))

if (m_RegisteredEvents.ContainsKey(eventName))
{
m_RegisteredEvents[eventName]();
try
{
m_RegisteredEvents[eventName]();
}
catch (Exception e)
{
Debug.LogError(string.Format("Caught {0} while sending Message {1}", e.GetType().Name, eventName));
Debug.LogException(e);
}
}
else
{

正在加载...
取消
保存