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 - Therg

Pages: [1]
1
Support / Re: DestroyImmidiate
« on: November 26, 2013, 07:04:14 pm »
I am using 2d toolkit 2.3.0 and unity 4.3.04f. I don't think there is anything special with my setup.

2
Support / DestroyImmidiate
« on: November 25, 2013, 09:42:25 pm »
Hey I have been started to get an error message since I updated to unity 4.3. I get the error message several times when I enter play mode/exit play mode. The error message is:

Destroying object multiple times. Don't use DestroyImmediate on the same object in OnDisable or OnDestroy.
UnityEngine.Object:DestroyImmediate(Object)
tk2dUtil:DestroyImmediate(Object) (at Assets/TK2DROOT/tk2d/Code/tk2dUtil.cs:50)
tk2dRuntime.TileMap.SpriteChunk:DestroyColliderData(tk2dTileMap) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapChunks.cs:68)
tk2dRuntime.TileMap.Layer:DestroyGameData(tk2dTileMap) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapChunks.cs:404)
tk2dTileMap:OnDestroy() (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:146)

The code looks like this:

public static void DestroyImmediate( UnityEngine.Object obj ) {
      if (obj == null) {
         return;
      }

      #if UNITY_EDITOR && !(UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2)
            if (!Application.isPlaying && undoEnabled) {
               UnityEditor.Undo.DestroyObjectImmediate(obj);
            }
            else
      #endif
      {
         UnityEngine.Object.DestroyImmediate(obj);
      }
   }

Do you have any suggestion about what I can do to get rid of the error message?

Thanks //Oscar

Pages: [1]