1
Support / Re: Issues with Unity 2018
« on: February 26, 2019, 08:45:58 am »
Hi guys, I contacted Unikron with some changes to fix the path issue some days ago but so far I have no official response. If you want to try something on your own here is what I did. Unity Experimental brings Prefab Stage which is some context when you access Prefab Edit Mode. I hope it helps.
Code: [Select]
public static string GetPathFromSpriteCollectionInPrefabEditMode(tk2dSpriteCollection gen)
{
if (gen == null) return null;
string assetPath = AssetDatabase.GetAssetPath(gen);
if (string.IsNullOrEmpty(assetPath))
{
PrefabStage prefabStage = PrefabStageUtility.GetPrefabStage(gen.gameObject);
if (prefabStage != null)
{
assetPath = prefabStage.prefabAssetPath;
}
}
return assetPath;
}