当前位置: 代码迷 >> 综合 >> NGUI.EventDelegate.Set()方法.点击Inspector直接打开方法体
  详细解决方案

NGUI.EventDelegate.Set()方法.点击Inspector直接打开方法体

热度:83   发布时间:2024-01-18 06:55:45.0

找到NGUI的EventDelegateEditor脚本.搜索"Notify"这个字符串

大概104行吧.

点封红色箭头飞到脚本上去

//上接点击减号,remove方法GUILayout.Space(-50);if (GUILayout.Button("o", GUILayout.Width(15), GUILayout.Height(15))){var tField = typeof(EventDelegate).GetField("mCachedCallback", BindingFlags.Instance | BindingFlags.NonPublic);if (tField != null){var tCall = tField.GetValue(del) as EventDelegate.Callback;if (tCall != null && tCall.Target != null && tCall.Method != null){var tScriptName = tCall.Target.GetType().Name;var tMethodName = tCall.Method.Name;var tScriptPath = AssetDatabase.FindAssets("t:Script " + tScriptName, new string[] { "Assets" });var tObj = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(tScriptPath[0])) as TextAsset;var tLineIndex = 1;var t = tObj.text.Split("\r\n".ToCharArray());for (int i = 0; i < t.Length; i++){if (t[i].Contains(tMethodName + "()")){tLineIndex = i;break;}}if (tLineIndex > 1)AssetDatabase.OpenAsset(tObj, tLineIndex / 2 + 1);}}}