2D Toolkit Forum

2D Toolkit => Support => Topic started by: NMD on February 05, 2017, 11:33:13 pm

Title: SetDirty cannot be used during play mode.
Post by: NMD on February 05, 2017, 11:33:13 pm
Hello,

Recently updated 2dtk and am getting this error...

To updated 2dtk, like I usually do, I made a new scene, imported 2dtk, and rebuild index.

Code: [Select]
InvalidOperationException: This cannot be used during play mode.
UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty (Scene scene) (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorSceneManagerBindings.gen.cs:156)
tk2dUtil.SetDirty (UnityEngine.Object object) (at Assets/[Vendor]/TK2DROOT/tk2d/Code/tk2dUtil.cs:128)

It's coming after an assignment to tk2dbasesprtie.sortingOrder.

I found another post about that particular function(tk2dUtil.SetDirty), but it does not seem to apply here. Thanks!
Title: Re: SetDirty cannot be used during play mode.
Post by: NMD on February 06, 2017, 10:20:19 pm
So, we were on 5.4 and somehow the update to 5.5 fixed this.
Title: Re: SetDirty cannot be used during play mode.
Post by: unikronsoftware on February 07, 2017, 11:54:17 am
I am still investigating this to figure out why it was doing it in the first place. Will get back to you this week.
Title: Re: SetDirty cannot be used during play mode.
Post by: NMD on April 07, 2017, 02:59:38 am
Well... lol

Just updated from 5.5 to 5.6 and getting this again.

I've rebuilt index twice, still getting this when I set a sprite sorting order...

Code: [Select]
InvalidOperationException: This cannot be used during play mode.
UnityEditor.SceneManagement.EditorSceneManager.MarkSceneDirty (Scene scene) (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorSceneManagerBindings.gen.cs:165)
tk2dUtil.SetDirty (UnityEngine.Object object) (at Assets/[Vendor]/TK2DROOT/tk2d/Code/tk2dUtil.cs:128)
tk2dBaseSprite.set_SortingOrder (Int32 value) (at Assets/[Vendor]/TK2DROOT/tk2d/Code/Sprites/tk2dBaseSprite.cs:183)
Title: Re: SetDirty cannot be used during play mode.
Post by: unikronsoftware on April 07, 2017, 10:16:12 am
I thought I'd fixed that in the last release... I'll look again tonight. I've been fixing some 5.6 specific things, this will fit right in.
Title: Re: SetDirty cannot be used during play mode.
Post by: unikronsoftware on April 17, 2017, 06:29:37 pm
All of these should be fixed now, will be releasing an update.