1
NGUI 3 Support / EventDelegateEditor change request
« on: December 02, 2014, 05:39:17 AM »
Hello, im using Field method of EventDelegateEditor draw EventDelegate field for my costume editor, and im getting Null refrence on multi-select of list variable. Adding fixes problem, so please add it to NGUI. Thx =)
- if (list != null && list.Any())
- static public void Field (Object undoObject, List<EventDelegate> list, string noTarget, string notValid, bool minimalistic)
- {
- bool targetPresent = false;
- bool isValid = false;
- if (list != null && list.Any()) //<------ this check
- {
- // Draw existing delegates
- for (int i = 0; i < list.Count;)
- {
- EventDelegate del = list[i];
- if (del == null || (del.target == null && !del.isValid))
- {
- list.RemoveAt(i);
- continue;
- }
- Field(undoObject, del, true, minimalistic);
- EditorGUILayout.Space();
- if (del.target == null && !del.isValid)
- {
- list.RemoveAt(i);
- continue;
- }
- if (del.target != null) targetPresent = true;
- isValid = true;
- ++i;
- }
- }