parent
3b9a377fb4
commit
5a2c5e7e96
23 changed files with 102 additions and 115 deletions
@ -1,23 +0,0 @@ |
||||
%YAML 1.1 |
||||
%TAG !u! tag:unity3d.com,2011: |
||||
--- !u!114 &11400000 |
||||
MonoBehaviour: |
||||
m_ObjectHideFlags: 0 |
||||
m_CorrespondingSourceObject: {fileID: 0} |
||||
m_PrefabInstance: {fileID: 0} |
||||
m_PrefabAsset: {fileID: 0} |
||||
m_GameObject: {fileID: 0} |
||||
m_Enabled: 1 |
||||
m_EditorHideFlags: 0 |
||||
m_Script: {fileID: 11500000, guid: b991a97e1e8f4ac7bbebd5263dafb1c3, type: 3} |
||||
m_Name: Hello |
||||
m_EditorClassIdentifier: |
||||
nodes: [] |
||||
nodeLinks: [] |
||||
entryNode: |
||||
rid: -2 |
||||
references: |
||||
version: 2 |
||||
RefIds: |
||||
- rid: -2 |
||||
type: {class: , ns: , asm: } |
@ -1,8 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 4c206553cd2be4144994dc84eefb649d |
||||
NativeFormatImporter: |
||||
externalObjects: {} |
||||
mainObjectFileID: 11400000 |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -1,30 +0,0 @@ |
||||
using UnityEditor; |
||||
using UnityEngine; |
||||
using UnityEngine.UIElements; |
||||
|
||||
public class TestGraphEditor : EditorWindow |
||||
{ |
||||
[SerializeField] |
||||
private VisualTreeAsset m_VisualTreeAsset = default; |
||||
|
||||
[MenuItem("Window/UI Toolkit/TestGraphEditor")] |
||||
public static void ShowExample() |
||||
{ |
||||
TestGraphEditor wnd = GetWindow<TestGraphEditor>(); |
||||
wnd.titleContent = new GUIContent("TestGraphEditor"); |
||||
} |
||||
|
||||
public void CreateGUI() |
||||
{ |
||||
// Each editor window contains a root VisualElement object |
||||
VisualElement root = rootVisualElement; |
||||
|
||||
// VisualElements objects can contain other VisualElement following a tree hierarchy. |
||||
VisualElement label = new Label("Hello World! From C#"); |
||||
root.Add(label); |
||||
|
||||
// Instantiate UXML |
||||
VisualElement labelFromUXML = m_VisualTreeAsset.Instantiate(); |
||||
root.Add(labelFromUXML); |
||||
} |
||||
} |
@ -1,11 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 7755292ea9ad7684eb1fc2040280fe50 |
||||
MonoImporter: |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
@ -1,5 +0,0 @@ |
||||
.custom-label { |
||||
font-size: 20px; |
||||
-unity-font-style: bold; |
||||
color: rgb(68, 138, 255); |
||||
} |
@ -1,11 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: 867e511d719e0f14e871be51fb547391 |
||||
ScriptedImporter: |
||||
internalIDToNameTable: [] |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
script: {fileID: 12385, guid: 0000000000000000e000000000000000, type: 0} |
||||
disableValidation: 0 |
@ -1,12 +0,0 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<engine:UXML |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xmlns:engine="UnityEngine.UIElements" |
||||
xmlns:editor="UnityEditor.UIElements" |
||||
xsi:noNamespaceSchemaLocation="../../UIElementsSchema/UIElements.xsd" |
||||
> |
||||
<Style src="project://database/Assets/Usage/TestGraphEditor.uss?fileID=7433441132597879392&guid=867e511d719e0f14e871be51fb547391&type=3#TestGraphEditor" /> |
||||
<engine:Label text="Hello World! From UXML" /> |
||||
<engine:Label class="custom-label" text="Hello World! With Style" /> |
||||
|
||||
</engine:UXML> |
@ -1,10 +0,0 @@ |
||||
fileFormatVersion: 2 |
||||
guid: ffc40a0c26876d9409f59e3252e7c29b |
||||
ScriptedImporter: |
||||
internalIDToNameTable: [] |
||||
externalObjects: {} |
||||
serializedVersion: 2 |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
||||
script: {fileID: 13804, guid: 0000000000000000e000000000000000, type: 0} |
Loading…
Reference in new issue