Hello Guest

Author Topic: SetDirty cannot be used during play mode.  (Read 7122 times)

NMD

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
SetDirty cannot be used during play mode.
« 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!

NMD

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: SetDirty cannot be used during play mode.
« Reply #1 on: February 06, 2017, 10:20:19 pm »
So, we were on 5.4 and somehow the update to 5.5 fixed this.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: SetDirty cannot be used during play mode.
« Reply #2 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.

NMD

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: SetDirty cannot be used during play mode.
« Reply #3 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)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: SetDirty cannot be used during play mode.
« Reply #4 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: SetDirty cannot be used during play mode.
« Reply #5 on: April 17, 2017, 06:29:37 pm »
All of these should be fixed now, will be releasing an update.
« Last Edit: April 17, 2017, 06:31:42 pm by unikronsoftware »