Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 private static void UpdateSchema()
 {
     UIGlobalSettings.GetOrCreateSettings().Refresh();
 }