Manual/UIE-manage-asset-reference #664
Replies: 1 comment
-
|
An example with serialization references using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
public class MyWindow : EditorWindow
{
[SerializeField]
public VisualTreeAsset uxml;
[SerializeField]
public StyleSheet uss;
[MenuItem("Tools/MyWindow")]
public static void ShowWindow()
{
var window = GetWindow<MyWindow>("MyWindow");
VisualElement ui = window.uxml.Instantiate();
ui.styleSheets.Add(window.uss);
window.rootVisualElement.Add(ui);
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Manual/UIE-manage-asset-reference
https://docs.unity3d.com/Manual/UIE-manage-asset-reference.html
Beta Was this translation helpful? Give feedback.
All reactions