Inventory inventory;//所属类 public Slot(Inventory inventory, GameObject go) { this.inventory = inventory; slotGo = go; UIEventListener.GetListener(slotGo).OnHover = OnMouseEnter; UIEventListener.GetListener(slotGo).OnMouseBeginDrag = OnBeginDrag; UIEventListener.GetListener(slotGo).OnMouseDrag = OnDrag; UIEventListener.GetListener(slotGo).OnMouseDragEnd = OnEndDrag; UIEventListener.GetListener(slotGo).OnMouseExit = OnMouseExit; }