Minor patchfix on HSS/VSS - Starting screen validation failed on new scenes?

--HG--
branch : develop_5.3
pull/413/head
Simon Jackson 2017-01-02 18:17:18 +00:00
parent 9718cb3f98
commit 21ad76580e
2 changed files with 3 additions and 2 deletions

View File

@ -340,9 +340,10 @@ namespace UnityEngine.UI.Extensions
private void OnValidate() private void OnValidate()
{ {
if (_screensContainer || ChildObjects != null) var children = gameObject.GetComponent<ScrollRect>().content.childCount;
if (children != 0 || ChildObjects != null)
{ {
var childCount = ChildObjects == null ? _screensContainer.childCount : ChildObjects.Length; var childCount = ChildObjects == null || ChildObjects.Length == 0 ? children : ChildObjects.Length;
if (StartingScreen > childCount - 1) if (StartingScreen > childCount - 1)
{ {
StartingScreen = childCount - 1; StartingScreen = childCount - 1;

Binary file not shown.