Skip to content

Commit

Permalink
Fix on-screen controller non-interactable after re-enabling
Browse files Browse the repository at this point in the history
  • Loading branch information
JLChnToZ committed Aug 28, 2023
1 parent 46a31a2 commit cf71452
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Packages/idv.jlchntoz.vvmw/Runtime/VVMW/UIHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ void Start() {
_OnVolumeChange();
_OnSyncOffsetChange();
UpdatePlayerText();
}

void OnEnable() {
if (playbackControlsAnimator != null) playbackControlsAnimator.SetTrigger("Init");
}

Expand Down Expand Up @@ -582,7 +585,7 @@ bool UpdatePlayList() {
entry.gameObject.SetActive(false);
}
lastDisplayCount = displayCount;
ScrollPlayListToCurrent();
SendCustomEventDelayedFrames(nameof(_ScrollPlayListToCurrent), 0);
return true;
}

Expand Down Expand Up @@ -619,7 +622,7 @@ public void _OnPlayListSelectClick() {
var entry = playListEntries[i];
if (entry != null) entry.Selected = i == selectedPlayListIndex;
}
if (!UpdatePlayList()) ScrollPlayListToCurrent();
if (!UpdatePlayList()) SendCustomEventDelayedFrames(nameof(_ScrollPlayListToCurrent), 0);
}

public void _OnCurrentPlayListSelectClick() {
Expand Down Expand Up @@ -681,7 +684,7 @@ void UpdateProgressOnce() {
}
}

void ScrollPlayListToCurrent() {
public void _ScrollPlayListToCurrent() {
if (queueListRoot == null) return;
var viewport = queueListRoot.viewport;
var position = viewport.position;
Expand Down

0 comments on commit cf71452

Please sign in to comment.