Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions CommunityEntity.UI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,9 @@ private void BuildScrollbar(Scrollbar scrollbar, JSON.Object obj, bool vertical)

static IEnumerator FadeCanvasGroup(CanvasGroup group, float to, float duration)
{
if(group == null)
yield break;

float from = group.alpha;
float elapsed = 0f;
while (elapsed < duration)
Expand All @@ -1029,11 +1032,13 @@ static IEnumerator FadeCanvasGroup(CanvasGroup group, float to, float duration)
group.alpha = value;
yield return null;
// another fade changed the value since we set it, abort
if (group.alpha != value)
if (group == null || group.alpha != value)
yield break;
}
group.alpha = to;
}

if(group != null)
group.alpha = to;
}

// sets the transform to a sensible default
private void FitParent(RectTransform transform){
Expand Down