Added patch to limit the Reorderable List component to Screenspace-Overlay canvases for now to avoid issues until it can be updated.
--HG-- branch : develop_5.3pull/413/head
parent
2b0c2d805a
commit
df39a76f3c
|
@ -44,6 +44,28 @@ namespace UnityEngine.UI.Extensions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Canvas GetCanvas()
|
||||||
|
{
|
||||||
|
Transform t = transform;
|
||||||
|
Canvas canvas = null;
|
||||||
|
|
||||||
|
|
||||||
|
int lvlLimit = 100;
|
||||||
|
int lvl = 0;
|
||||||
|
|
||||||
|
while (canvas == null && lvl < lvlLimit)
|
||||||
|
{
|
||||||
|
canvas = t.gameObject.GetComponent<Canvas>();
|
||||||
|
if (canvas == null)
|
||||||
|
{
|
||||||
|
t = t.parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
lvl++;
|
||||||
|
}
|
||||||
|
return canvas;
|
||||||
|
}
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -61,6 +83,11 @@ namespace UnityEngine.UI.Extensions
|
||||||
Debug.LogError("You need to have a Graphic control (such as an Image) for the list [" + name + "] to be droppable", gameObject);
|
Debug.LogError("You need to have a Graphic control (such as an Image) for the list [" + name + "] to be droppable", gameObject);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (GetCanvas().renderMode != RenderMode.ScreenSpaceOverlay)
|
||||||
|
{
|
||||||
|
Debug.LogError("The ReOrderable List is only supported on a Screenspace-Overlay Canvas at the moment");
|
||||||
|
}
|
||||||
|
|
||||||
_listContent = ContentLayout.gameObject.AddComponent<ReorderableListContent>();
|
_listContent = ContentLayout.gameObject.AddComponent<ReorderableListContent>();
|
||||||
_listContent.Init(this);
|
_listContent.Init(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue