• RuntimesUnity
  • Unity presets are holding a reference to spine Skeleton Data Asset

I'm trying to save a preset with the current SkeletonGraphic UI settings, but Unity presets are holding a reference to the Skeleton data asset. When I apply the preset to a different SkeletonGraphic component, it also applies a reference to the previously saved skeleton data asset. The expected result is to apply only the settings under SkeletonGraphic UI

Is there a workaround for this issue?

Related Discussions
...

Thanks SpineBot, but that is not working for me. 🙁

@Nay You can edit what to apply from a Preset asset by selecting the preset in the Project window and right-clicking the desired value to be excluded and hitting "Exclude Property". See "Applying partial Presets" on this documentation page: https://docs.unity3d.com/Manual/Presets.html.


Admittedly I found the above solution after having written the alternatives below. Still listing them in case it helps anyone with a different use-case:

A completely different solution would be to write your own editor script to either create a custom utility editor window which has a few properties like Source SkeletonGraphic and Target GameObject, or to create a script which adds two SkeletonGraphic context menu items to copy and past only some values.

static SkeletonGraphic sourceSkeletonGraphic;

[MenuItem ("CONTEXT/SkeletonGraphic/Copy Component Values Only")]
static void CopyComponentValues (MenuCommand command) {
    sourceSkeletonGraphic = (SkeletonGraphic)command.context;
}

[MenuItem ("CONTEXT/SkeletonGraphic/Paste Component Values Only")]
static void PasteComponentValues (MenuCommand command) {
    SkeletonGraphic target = (SkeletonGraphic)command.context;
    EditorUtility.CopySerialized(sourceSkeletonGraphic, target); // untested, might be wrong
}