This ensures prefab reference as serialize field in another object persists on corresponding .scml file reimport.
For example, imaging having behaviour like this
using UnityEngine;
using SpriterDotNetUnity;
public class SDNBehTest : MonoBehaviour
{
[SerializeField]
private SpriterDotNetBehaviour sdnPrefab;
}
And prefab generated by SpriterDotNet linked to sdnPrefab field in the scene. Reimporting .scml file will result in PrefabUtility.ReplacePrefab called with ReplacePrefabOptions.Default which results into prefab reference being lost for SDNBehTest in the scene.
Another thing. Even if prefab references is not the case for the project (for example prefabs are loaded via Resources by path), reimporting with ReplacePrefabOptions.Default results in internal prefab structure being changed dramatically on .scml file reimport (and source control diff would report that). This is undesired behavior for the case of .scml file was not changed.
This ensures prefab reference as serialize field in another object persists on corresponding .scml file reimport.
For example, imaging having behaviour like this
And prefab generated by SpriterDotNet linked to
sdnPrefab
field in the scene. Reimporting.scml
file will result inPrefabUtility.ReplacePrefab
called withReplacePrefabOptions.Default
which results into prefab reference being lost forSDNBehTest
in the scene.Another thing. Even if prefab references is not the case for the project (for example prefabs are loaded via
Resources
by path), reimporting withReplacePrefabOptions.Default
results in internal prefab structure being changed dramatically on.scml
file reimport (and source control diff would report that). This is undesired behavior for the case of.scml
file was not changed.Closes #73.