Merged in leonkj/unity-ui-extensions (pull request #31)
Fix reorderable lists Fantastic fix, thank you very much for the contribution.release
commit
2885d851d1
|
@ -67,6 +67,15 @@ namespace UnityEngine.UI.Extensions
|
||||||
return canvas;
|
return canvas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Refresh related list content
|
||||||
|
/// </summary>
|
||||||
|
public void Refresh()
|
||||||
|
{
|
||||||
|
_listContent = ContentLayout.gameObject.AddComponent<ReorderableListContent>();
|
||||||
|
_listContent.Init(this);
|
||||||
|
}
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -85,8 +94,7 @@ namespace UnityEngine.UI.Extensions
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_listContent = ContentLayout.gameObject.AddComponent<ReorderableListContent>();
|
Refresh();
|
||||||
_listContent.Init(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Nested type: ReorderableListEventStruct
|
#region Nested type: ReorderableListEventStruct
|
||||||
|
|
|
@ -227,6 +227,10 @@ namespace UnityEngine.UI.Extensions
|
||||||
|
|
||||||
_reorderableList.OnElementAdded.Invoke(args);
|
_reorderableList.OnElementAdded.Invoke(args);
|
||||||
|
|
||||||
|
// Force refreshing both lists because otherwise we get inappropriate FromList in ReorderableListEventStruct
|
||||||
|
_reorderableList.Refresh();
|
||||||
|
_currentReorderableListRaycasted.Refresh();
|
||||||
|
|
||||||
if(!isValid) throw new Exception("It's too late to cancel the Transfer! Do so in OnElementDropped!");
|
if(!isValid) throw new Exception("It's too late to cancel the Transfer! Do so in OnElementDropped!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue