public override void OnActivate(string searchContext, VisualElement rootElement) { serializedObject = UIGlobalSettings.GetOrCreateSerializedSettings(); var uxml = AssetDatabase.LoadAssetAtPath <VisualTreeAsset>(UXML); if (rootElement == null) { rootElement = new VisualElement(); } else { rootElement.Clear(); } uxml.CloneTree(rootElement); rootElement.Bind(serializedObject); rootElement.Q <Button>("refresh-schema").clicked += () => (serializedObject.targetObject as UIGlobalSettings)?.Refresh(); }
private static void UpdateSchema() { UIGlobalSettings.GetOrCreateSettings().Refresh(); }