void OnEnable() { var tokenAuth = new TokenAuthWidget(); tokenAuth.AddView(rootVisualElement); rootVisualElement.Add(UiUtils.Separator()); VisualElement loggedInUiContainer = null; ReactiveBinder.Bind(tokenAuth.reactiveUserInfo, userInfo => { if (loggedInUiContainer != null) { rootVisualElement.Remove(loggedInUiContainer); } if (userInfo.HasValue) { loggedInUiContainer = CreateVenueUi(userInfo.Value); rootVisualElement.Add(loggedInUiContainer); } else { loggedInUiContainer = null; } }); }
void OnEnable() { tokenAuth = new TokenAuthWidget(); tokenAuth.AddView(rootVisualElement); rootVisualElement.Add(UiUtils.Separator()); rootVisualElement.Add(new IMGUIContainer(LegacyOnGUI)); }