[unity] ui-toolkit package: Code cleanup, added documentation. See #1943.

This commit is contained in:
Harald Csaszar 2024-07-03 10:32:06 +02:00
parent f3b3cb429a
commit d982710070
4 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 38ed300e2ddd57841ab636ca4a49fc18
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
## Spine UI Toolkit Extension [Experimental]
This experimental plugin provides integration of UI Toolkit for the spine-unity runtime. Please be sure to test this package first and create backups of your project before using.
The plugin adds a `SpineVisualElement` control element to be used with UI Toolkit, providing functionality similar to `SkeletonGraphic` to add your Spine skeletons to a Visual Tree Asset via UI Toolkit's UI Builder.
### Usage
For usage of the `SpineVisualElement` control element, you can check out the included `UI Toolkit Example.unity` example scene and `SpineUIToolkit.uxml` file which can be installed via the `Samples` tab in the Unity Package Manager window.
The new `SpineVisualElement` can be found in the Unity `UI Builder` window under `Library - Project - Custom Controls` `Spine - Unity - SpineVisualElement`. It can be added to your hierarchy and configured as normal UI Toolkit elements while providing Spine skeleton attributes as well.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e57aa0442e306ce44b13d22c2c749753
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -39,7 +39,6 @@ namespace Spine.Unity {
[UxmlElement] [UxmlElement]
public partial class SpineVisualElement : VisualElement { public partial class SpineVisualElement : VisualElement {
public new class UxmlFactory : UxmlFactory<SpineVisualElement, UxmlTraits> { }
[SpineAnimation(dataField: "SkeletonDataAsset", avoidGenericMenu: true)] [SpineAnimation(dataField: "SkeletonDataAsset", avoidGenericMenu: true)]
[UxmlAttribute] [UxmlAttribute]