Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jason.appx

Pages: [1]
1
Releases / Re: 2D Toolkit 2.5.8.1
« on: June 19, 2017, 03:55:12 am »
Hi,

When using tk2d in Unity 5.5.3, I found that some components were not properly set dirty when modified. Then I found out that the SetDirty function in tk2dUtil does not have the pre-processor UNITY_5_5. Is this bug or intended?

Currently I added UNITY_5_5 to that line as a workaround.

Code: [Select]
// Replicate old pre-5.3 behaviour
public static void SetDirty(UnityEngine.Object @object)
{
#if UNITY_EDITOR
if (Application.isPlaying)
{
return;
}

UnityEditor.EditorUtility.SetDirty(@object);

#if (UNITY_5_3 || UNITY_5_4 || UNITY_5_6 || UNITY_5_7 || UNITY_5_8 || UNITY_5_9 || UNITY_6_0)
string objectPath = UnityEditor.AssetDatabase.GetAssetPath(@object);
if (string.IsNullOrEmpty(objectPath))
{
string scenePath = UnityEditor.AssetDatabase.GetAssetOrScenePath(@object);
var scene = UnityEditor.SceneManagement.EditorSceneManager.GetSceneByPath(scenePath);
if (scene.IsValid())
{
UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty(scene);
}
}
#endif

#endif // UNITY_EDITOR
}

Pages: [1]