Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
d9119e1
Update project
AlexanderVorobyov Jun 23, 2024
161656a
Add UIToolkitFieldUtility
AlexanderVorobyov Jun 23, 2024
38da7af
Add GlobalIdTextFieldElement
AlexanderVorobyov Jun 23, 2024
2c7e4c8
Update project
AlexanderVorobyov Jun 29, 2024
694c53e
Update project
AlexanderVorobyov Jun 29, 2024
7b8c895
Add UIToolkitEditorUtility
AlexanderVorobyov Jun 29, 2024
5267b69
Add GlobalIdBindingTextField
AlexanderVorobyov Jun 29, 2024
49f3cf1
Update TestGlobalIdAsset.cs
AlexanderVorobyov Jun 29, 2024
b307225
Add UIToolkitPropertyBindingField
AlexanderVorobyov Jun 29, 2024
c77131a
Update AssetIdAttributePropertyDrawer.cs
AlexanderVorobyov Jun 29, 2024
238f414
Add GlobalIdFieldElement
AlexanderVorobyov Jun 30, 2024
98f1061
Update .gitignore
AlexanderVorobyov Jun 30, 2024
a84ab25
Change UIToolkitEditorUtility
AlexanderVorobyov Jul 1, 2024
3cc7dad
Update AssetIdAttributePropertyDrawer.cs
AlexanderVorobyov Jul 1, 2024
b5393f4
Change package folder name
AlexanderVorobyov Jul 1, 2024
3d90158
Change project settings
AlexanderVorobyov Jul 1, 2024
e8a8b01
Add style sheets
AlexanderVorobyov Jul 1, 2024
58791c3
Add ObjectFieldLinkedElement
AlexanderVorobyov Jul 1, 2024
8a677cd
Add AssetIdObjectFieldElement
AlexanderVorobyov Jul 1, 2024
a3b0465
Add TestDocument
AlexanderVorobyov Jul 1, 2024
4844b22
Change style sheets folder
AlexanderVorobyov Jul 7, 2024
7e5cd55
Update UIToolkitEditorUtility.cs
AlexanderVorobyov Jul 7, 2024
464e0ce
Change style sheets folder
AlexanderVorobyov Jul 7, 2024
0225097
Add IconButtonElement
AlexanderVorobyov Jul 7, 2024
337cafa
Add ReferenceObjectFieldElement
AlexanderVorobyov Jul 7, 2024
350eee0
Update ProjectVersion.txt
AlexanderVorobyov Jul 7, 2024
f14e8b8
Update UGF.EditorTools.Editor.Styles.uss
AlexanderVorobyov Jul 7, 2024
3919fcf
Add tests
AlexanderVorobyov Jul 7, 2024
60720a5
Update UGF.EditorTools.Editor.Styles.uss
AlexanderVorobyov Jul 7, 2024
c7a9a1d
Change elements
AlexanderVorobyov Jul 7, 2024
e6c87b7
Add tests
AlexanderVorobyov Jul 7, 2024
80414d2
Update ReferenceObjectFieldElement.cs
AlexanderVorobyov Jul 7, 2024
2a6f0c6
Remove ReferenceObjectFieldElement
AlexanderVorobyov Jul 7, 2024
e43f877
Change property drawers
AlexanderVorobyov Jul 7, 2024
2332c4d
Change UIToolkitPropertyBindingField
AlexanderVorobyov Jul 7, 2024
f27e813
Add select path attribute elements
AlexanderVorobyov Jul 7, 2024
44cccd7
Update TagDropdownAttributePropertyDrawer.cs
AlexanderVorobyov Jul 7, 2024
ef314a2
Change time select elements
AlexanderVorobyov Jul 7, 2024
31f82b4
Change select path elements
AlexanderVorobyov Jul 11, 2024
ac4ce60
Update project
AlexanderVorobyov Jul 11, 2024
03cd916
Change TimeSpanTicksFieldElement
AlexanderVorobyov Jul 11, 2024
5ef733d
Add TimeTicksFieldElement
AlexanderVorobyov Jul 11, 2024
93dbc3c
Fix time ticks elements
AlexanderVorobyov Jul 13, 2024
f4e2d12
Add AssetReferenceObjectFieldElement
AlexanderVorobyov Jul 13, 2024
3342f0c
Update TestEditorElementsUtilityAsset.cs
AlexanderVorobyov Jul 13, 2024
1b5cb36
Add DropdownFieldElement
AlexanderVorobyov Jul 13, 2024
658eedb
Add AssemblyReferenceDropdownFieldElement
AlexanderVorobyov Jul 13, 2024
13a8ba0
Add AssemblyReferenceDropdownFieldElement
AlexanderVorobyov Jul 13, 2024
f885f30
Change dropdown field elements
AlexanderVorobyov Jul 13, 2024
e121690
Add TypesDropdownFieldElement
AlexanderVorobyov Jul 13, 2024
91518be
Add EnabledPropertyFieldElement
AlexanderVorobyov Jul 14, 2024
6543eae
Update EnabledPropertyFieldElement.cs
AlexanderVorobyov Jul 15, 2024
a4e57b3
Update EnabledPropertyFieldElement.cs
AlexanderVorobyov Jul 15, 2024
8f602a7
Update EnabledPropertyDrawer.cs
AlexanderVorobyov Jul 15, 2024
3ff5e6d
Update TestEnabledPropertyAssetEditor.cs
AlexanderVorobyov Jul 15, 2024
d70f80c
Update EditorIMGUIUtility.cs
AlexanderVorobyov Jul 15, 2024
10beace
Add EditorInspectorElement
AlexanderVorobyov Jul 15, 2024
84ea43f
Add DropAreaElement
AlexanderVorobyov Jul 15, 2024
2aa0cf2
Update EditorDrawerTestAsset.cs
AlexanderVorobyov Jul 15, 2024
36a103a
Change UI Toolkit elements folders
AlexanderVorobyov Jul 16, 2024
bc75323
Update TestEditorElementsUtilityAsset.cs
AlexanderVorobyov Jul 16, 2024
92eddf8
Change EnabledPropertyFieldElement
AlexanderVorobyov Jul 16, 2024
0e97be3
Change editor styles
AlexanderVorobyov Jul 16, 2024
a520047
Add ListElement
AlexanderVorobyov Jul 16, 2024
96e456e
Update project
AlexanderVorobyov Aug 4, 2024
42a580f
Change types dropdown element directory
AlexanderVorobyov Aug 4, 2024
7388774
Add HideLabelAttribute
AlexanderVorobyov Aug 4, 2024
226279b
Update TestAssetReferenceAsset.cs
AlexanderVorobyov Aug 4, 2024
48587e5
Update ListElement.cs
AlexanderVorobyov Aug 4, 2024
26d6eae
Add ListKeyAndValueElement
AlexanderVorobyov Aug 4, 2024
81b847a
Update ReorderableListTestAsset.cs
AlexanderVorobyov Aug 4, 2024
3feb699
Update ListElement.cs
AlexanderVorobyov Aug 5, 2024
d8ea9a2
Change ListKeyAndValueElement
AlexanderVorobyov Aug 5, 2024
c3362d9
Update EditorDrawerTestAsset.cs
AlexanderVorobyov Aug 5, 2024
43825f1
Add AssetIdReferenceListElement
AlexanderVorobyov Aug 5, 2024
50e842c
Add AssetIdReferenceListAttributePropertyDrawer
AlexanderVorobyov Aug 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ crashlytics-build.properties
/[Aa]ssets/[Ss]treamingAssets/aa.meta
/[Aa]ssets/[Ss]treamingAssets/aa/*
ProjectSettings/RiderScriptEditorPersistedState.asset
/UIElementsSchema
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
%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: bcca65976dec45a0a7cc22a47d33ec55, type: 3}
m_Name: New Test Asset Id Reference Asset 2
m_EditorClassIdentifier:
m_test: {fileID: 11400000, guid: 28ca3cd16791a7d4d8239d0664e44359, type: 2}
m_scriptable:
m_guid:
m_first: 17862470146234317747
m_second: 7112672179637281834
m_asset: {fileID: 11400000, guid: 6550fbb33df5f7e42a6415afa949b562, type: 2}
m_material:
m_guid:
m_first: 15525150360673092132
m_second: 3862614618297821529
m_asset: {fileID: 2100000, guid: 4c72822469ffd7745969dfc387c39a35, type: 2}
m_list:
- m_guid:
m_first: 5644284074733981451
m_second: 8935266605448331448
m_asset: {fileID: 2100000, guid: 15e9cf0b86764e54b88028f7a271007c, type: 2}
- m_guid:
m_first: 0
m_second: 0
m_asset: {fileID: 0}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Collections.Generic;
using UGF.EditorTools.Runtime.Assets;
using UnityEngine;

namespace UGF.EditorTools.Editor.Tests.Assets
{
[CreateAssetMenu(menuName = "Tests/TestAssetIdReferenceAsset2")]
public class TestAssetIdReferenceAsset2 : ScriptableObject
{
[SerializeField] private ScriptableObject m_test;
[SerializeField] private AssetIdReference<ScriptableObject> m_scriptable;
[SerializeField] private AssetIdReference<Material> m_material;
[SerializeField] private List<AssetIdReference<Material>> m_list = new List<AssetIdReference<Material>>();

public ScriptableObject Test { get { return m_test; } set { m_test = value; } }
public AssetIdReference<ScriptableObject> Scriptable { get { return m_scriptable; } set { m_scriptable = value; } }
public AssetIdReference<Material> Material { get { return m_material; } set { m_material = value; } }
public List<AssetIdReference<Material>> List { get { return m_list; } }
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
%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: 32f9c6f989b6412a9435ce6d227c9723, type: 3}
m_Name: New Test Asset Reference Asset 2
m_EditorClassIdentifier:
m_scriptable:
m_guid:
m_asset: {fileID: 0}
m_material:
m_guid:
m_asset: {fileID: 0}
m_list: []
m_list2: []

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using UGF.EditorTools.Editor.IMGUI;
using UGF.EditorTools.Editor.IMGUI.AssetReferences;
using UGF.EditorTools.Runtime.Attributes;
using UGF.EditorTools.Runtime.IMGUI.AssetReferences;
using UnityEditor;
using UnityEngine;
Expand All @@ -12,7 +13,9 @@ public class TestAssetReferenceAsset : ScriptableObject
{
[SerializeField] private AssetReference<ScriptableObject> m_scriptable;
[SerializeField] private AssetReference<Material> m_material;
[List, HideLabel]
[SerializeField] private List<AssetReference<Material>> m_list = new List<AssetReference<Material>>();
[List, HideLabel]
[SerializeField] private List<AssetReference<Material>> m_list2 = new List<AssetReference<Material>>();

public AssetReference<ScriptableObject> Scriptable { get { return m_scriptable; } set { m_scriptable = value; } }
Expand All @@ -22,7 +25,7 @@ public class TestAssetReferenceAsset : ScriptableObject
}

[CanEditMultipleObjects]
[CustomEditor(typeof(TestAssetReferenceAsset), true)]
// [CustomEditor(typeof(TestAssetReferenceAsset), true)]
public class TestAssetReferenceAssetEditor : UnityEditor.Editor
{
private SerializedProperty m_propertyScriptable;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Collections.Generic;
using UGF.EditorTools.Runtime.IMGUI.AssetReferences;
using UnityEngine;

namespace UGF.EditorTools.Editor.Tests.IMGUI.AssetReferences
{
[CreateAssetMenu(menuName = "Tests/TestAssetReferenceAsset2")]
public class TestAssetReferenceAsset2 : ScriptableObject
{
[SerializeField] private AssetReference<ScriptableObject> m_scriptable;
[SerializeField] private AssetReference<Material> m_material;
[SerializeField] private List<AssetReference<Material>> m_list = new List<AssetReference<Material>>();
[SerializeField] private List<AssetReference<Material>> m_list2 = new List<AssetReference<Material>>();

public AssetReference<ScriptableObject> Scriptable { get { return m_scriptable; } set { m_scriptable = value; } }
public AssetReference<Material> Material { get { return m_material; } set { m_material = value; } }
public List<AssetReference<Material>> List { get { return m_list; } }
public List<AssetReference<Material>> List2 { get { return m_list2; } }
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using UGF.EditorTools.Runtime.IMGUI.Attributes;
using UGF.EditorTools.Runtime.Attributes;
using UGF.EditorTools.Runtime.IMGUI.Attributes;
using UnityEngine;
using UnityEngine.SceneManagement;

Expand Down Expand Up @@ -39,6 +40,9 @@ public class TestAttributesAsset : ScriptableObject, ITestAttributesAsset
[SerializeField, ResourcesPath(typeof(Scene))]
private string m_resourcesScene;

[SerializeField, HideLabel]
private string m_hideLabel = "Hide Label";

public string Disabled { get { return m_disabled; } set { m_disabled = value; } }
public string AssetGuid { get { return m_assetGuid; } set { m_assetGuid = value; } }
public string GuidMaterial { get { return m_guidMaterial; } set { m_guidMaterial = value; } }
Expand All @@ -51,6 +55,7 @@ public class TestAttributesAsset : ScriptableObject, ITestAttributesAsset
public string ResourcesMaterial2 { get { return m_resourcesMaterial2; } set { m_resourcesMaterial2 = value; } }
public string ResourcesMaterial3 { get { return m_resourcesMaterial3; } set { m_resourcesMaterial3 = value; } }
public string ResourcesScene { get { return m_resourcesScene; } set { m_resourcesScene = value; } }
public string HideLabel { get { return m_hideLabel; } set { m_hideLabel = value; } }
}

public interface ITestAttributesAsset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace UGF.EditorTools.Editor.Tests.IMGUI.EnabledProperty
{
[CanEditMultipleObjects]
[CustomEditor(typeof(TestEnabledPropertyAsset), true)]
// [CustomEditor(typeof(TestEnabledPropertyAsset), true)]
public class TestEnabledPropertyAssetEditor : UnityEditor.Editor
{
private EnabledPropertyListDrawer m_list1;
Expand Down
23 changes: 23 additions & 0 deletions Assets/UGF.EditorTools.Editor.Tests/IMGUI/EditorDrawerTestAsset.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
using UGF.EditorTools.Editor.IMGUI;
using UGF.EditorTools.Editor.UIToolkit.Elements;
using UGF.EditorTools.Runtime.Assets;
using UGF.EditorTools.Runtime.Ids;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
using Object = UnityEngine.Object;

namespace UGF.EditorTools.Editor.Tests.IMGUI
Expand Down Expand Up @@ -62,6 +65,26 @@ public override void OnInspectorGUI()
m_dropAreaDrawer.DrawGUILayout();
}

public override VisualElement CreateInspectorGUI()
{
var element = new VisualElement();

InspectorElement.FillDefaultInspector(element, serializedObject, this);

var dropArea = new DropAreaElement(typeof(ScriptableObject));
var dropArea2 = new DropAreaElement(typeof(Material));

dropArea.Manipulator.Accepted += OnDropAreaDrawerAccepted;
dropArea2.Manipulator.Accepted += OnDropAreaDrawerAccepted;

element.Add(dropArea);
element.Add(dropArea2);
element.Add(new EditorObjectReferenceElement(m_propertyTarget));
element.Add(new EditorObjectReferenceIdElement(m_propertyTarget2));

return element;
}

private void OnDropAreaDrawerAccepted(Object asset)
{
Debug.Log($"Drop area accepted: '{asset}'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using UGF.EditorTools.Editor.IMGUI;
using UGF.EditorTools.Runtime.Assets;
using UGF.EditorTools.Runtime.Attributes;
using UGF.EditorTools.Runtime.Ids;
using UGF.EditorTools.Runtime.IMGUI.References;
using UnityEditor;
Expand All @@ -13,10 +14,16 @@ namespace UGF.EditorTools.Editor.Tests.IMGUI
[CreateAssetMenu(menuName = "Tests/ReorderableListTestAsset")]
public class ReorderableListTestAsset : ScriptableObject
{
[List]
[SerializeField] private List<ScriptableObject> m_list1;
[List, HideLabel]
[SerializeField] private List<ScriptableObject> m_list10;
[SerializeField] private List<ScriptableObject> m_list11;
[List]
[SerializeField] private List<Data1> m_list2;
[SerializeField] private List<Data2> m_list3;
[SerializeReference, ManagedReference] private List<IData> m_list4;
[ListKeyAndValue]
[SerializeField] private List<Entry> m_list5;
[AssetId]
[SerializeField] private List<GlobalId> m_list6;
Expand Down Expand Up @@ -49,7 +56,7 @@ public class Data2 : IData
}
}

[CustomEditor(typeof(ReorderableListTestAsset), true)]
// [CustomEditor(typeof(ReorderableListTestAsset), true)]
public class ReorderableListTestAssetEditor : UnityEditor.Editor
{
private EditorListDrawer m_drawer1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
using UGF.EditorTools.Editor.IMGUI;
using UGF.EditorTools.Editor.IMGUI.Dropdown;
using UGF.EditorTools.Editor.IMGUI.Scopes;
using UGF.EditorTools.Editor.UIToolkit;
using UGF.EditorTools.Editor.UIToolkit.Elements;
using UGF.EditorTools.Runtime.IMGUI.Attributes;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;

namespace UGF.EditorTools.Editor.Tests.IMGUI
{
Expand Down Expand Up @@ -62,6 +66,31 @@ public override void OnInspectorGUI()
}
}

public override VisualElement CreateInspectorGUI()
{
var element = new VisualElement();

InspectorElement.FillDefaultInspector(element, serializedObject, this);

var timeSpanTicksFieldArgumentsElement = new TimeSpanTicksFieldArgumentsElement
{
label = "Time Span Ticks Field Arguments"
};

var timeTicksFieldArgumentsElement = new TimeTicksFieldArgumentsElement()
{
label = "Time Ticks Field Arguments"
};

UIToolkitEditorUtility.AddFieldClasses(timeSpanTicksFieldArgumentsElement);
UIToolkitEditorUtility.AddFieldClasses(timeTicksFieldArgumentsElement);

element.Add(timeSpanTicksFieldArgumentsElement);
element.Add(timeTicksFieldArgumentsElement);

return element;
}

private IEnumerable<DropdownItem<string>> OnGetItems()
{
var items = new List<DropdownItem<string>>();
Expand Down
2 changes: 2 additions & 0 deletions Assets/UGF.EditorTools.Editor.Tests/Ids/TestGlobalIdAsset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ namespace UGF.EditorTools.Editor.Tests.Ids
public class TestGlobalIdAsset : ScriptableObject
{
[SerializeField] private GlobalId m_id;
[SerializeField] private GlobalId m_id3;
[AssetId(typeof(Material))]
[SerializeField] private GlobalId m_id2;

public GlobalId Id { get { return m_id; } set { m_id = value; } }
public GlobalId ID3 { get { return m_id3; } set { m_id3 = value; } }
public GlobalId ID2 { get { return m_id2; } set { m_id2 = value; } }
}
}
8 changes: 8 additions & 0 deletions Assets/UGF.EditorTools.Editor.Tests/UIToolkit.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="False">
<Style src="project://database/Packages/com.ugf.editortools/Data.Editor/UGF.EditorTools.Editor.Styles.uss?fileID=7433441132597879392&amp;guid=02fc77c2456fb854f836285bba201e73&amp;type=3#UGF.EditorTools.Editor.Styles" />
</ui:UXML>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
%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: eb4564209910452e8e93d94f69c791b9, type: 3}
m_Name: TestStylesAsset
m_EditorClassIdentifier:

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading