public void OnListAdd(GameObject gameObject, int index, object newElem) { if (gameObject == null) { return; } string listID = this.GetListID(gameObject); ListEvent listEvent = null; if (this.onListAdd.TryGetValue(listID, out listEvent) && listEvent != null) { listEvent.Invoke(index, null, newElem); } if (this.onListAny.TryGetValue(listID, out listEvent) && listEvent != null) { listEvent.Invoke(index, null, newElem); } }
public void OnPointerEnter(PointerEventData data) { if (draggedObject != null && !Input.GetMouseButton(0)) { if (draggedObject.tag == dropTag) { AddToList(draggedObject.gameObject); string test = draggedObject.gameObject.GetComponent <ListElement>().text.text; draggedObject.origin.elementDragged.Invoke(draggedObject.gameObject.GetComponent <ListElement>().text.text); elementDropped.Invoke(draggedObject.gameObject.GetComponent <ListElement>().text.text); draggedObject = null; } } }