- Editado
Unity 2020.1.6f1 SkeletonDataModifierAsset not called.
Hi Harald, the code below is never invoked. I have created new Scriptable object but nothing. Do I need to put my scriptable object in a special directory?
[CreateAssetMenu(menuName = "Scriptable Objects/IntegratorTool2D/SpineDataModifierAsset", order = 200)]
public class IntegratorTool2DSpineDataModifierAsset : SkeletonDataModifierAsset
{
public override void Apply(SkeletonData skeletonData)
{
Debug.Log("JEDETO");
}
}
Thanks for reporting! We could reproduce the problem on Unity 2020.1.7f1, confirmed working on Unity 2019.4.11f1.
The issue is tracked under this ticket:
https://github.com/EsotericSoftware/spine-runtimes/issues/1768
We will let you know once the problem has been resolved.
This one is project stopper. I tried to look into it but have not found where you register the scriptable objects into the list!
foriero escribióThis one is project stopper.
You should not upgrade your projects to unsupported Unity versions. It's like going down a road which has been closed due to construction work just to find that there is a hole in the ground that you cannot get over now.
But anyway, we are happy to fix it so that we can officially support 2020.1 soon.
foriero escribióI tried to look into it but have not found where you register the scriptable objects into the list!
You do know that you register them yourself at your SkeletonDataAsset
by adding them to the list manually? They are not automatically added, they never were.
Nevertheless, the new problem with Unity 2020.1 occurs when re-importing the directory containing the asset: the list in the SkeletonDataAsset
briefly contains no entries when they should be processed, after that the entries are de-serialized but then it's too late. This will be fixed in the mentioned ticket.
The issue documented in the ticket also turns out to have been false alarm. After adding a SkeletonDataModifierAsset
to the list of a SkeletonDataAsset
, you have to save the asset once, afterwards upon either a) modifying the json skeleton file or b) reimporting the parent directory, the SkeletonDataModifierAsset
Apply()
method is called correctly.
Just without saving, it behaved inconsistently, most of the time not applying the SkeletonDataModifierAsset
. Closing the ticket now.
Thank you.
Harald, may I ask you to set this in your Spine editor utilities? https://docs.unity3d.com/ScriptReference/AssetPostprocessor.GetPostprocessOrder.html
The reason is that we need to do some additional postprocessing ( even after the modifiers ) and without the order I'm not unable to set our AssetPostprocessor with higher number so that it is called after yours.
For now I'm doing this in our postprocessor:
public override int GetPostprocessOrder() => int.MaxValue;
May be you do this:
public override int GetPostprocessOrder() => int.MaxValue - 1;
Thank you, Marek.
You're welcome.
foriero escribióHarald, may I ask you to set this in your Spine editor utilities? https://docs.unity3d.com/ScriptReference/AssetPostprocessor.GetPostprocessOrder.html
[..]
The reason is that we need to do some additional postprocessing ( even after the modifiers ) and without the order I'm not unable to set our AssetPostprocessor with higher number so that it is called after yours.
The default AssetPostprocessor
implementation returns 0 at GetPostprocessOrder
, see the source code here:
https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/AssetPostprocessor.cs#L66
Setting it to a higher value will not make it earlier.
I assume that the problem you see is related to this documentation line:
https://docs.unity3d.com/ScriptReference/AssetPostprocessor.GetPostprocessOrder.html escribióThe GetPostprocessOrder function does not affect the order of OnPostprocessAllAssets calls.
I also don't know why the behaviour is designed like this, perhaps you can sign a "bad design" ticket at Unity. Chances are low however that this will improve.
Harald escribióperhaps you can sign a "bad design" ticket at Unity
Haha, I would love if this worked! :headwall: