2D Toolkit Forum

2D Toolkit => Support => Topic started by: babarzor on July 24, 2017, 05:14:14 pm

Title: unity 2017
Post by: babarzor on July 24, 2017, 05:14:14 pm
hello, i tried to migrate my project on the new version of Unity. it works perfectly execpt a small detail: i have a warning at each update:
SendMessage cannot be called during Awake, CheckConsistency, or OnValidate
UnityEngine.MeshFilter:set_sharedMesh(Mesh)
tk2dSprite:OnValidate() (at Assets/TK2DROOT/tk2d/Code/Sprites/tk2dSprite.cs:118)

that doesn't seem to block the game...
(sorry for my english.. im french :-p )
Title: Re: unity 2017
Post by: unikronsoftware on July 24, 2017, 09:14:48 pm
How old is your 2d toolkit? The latest one still has a couple small issues but all of these should have been fixed ages ago...
Title: Re: unity 2017
Post by: babarzor on July 25, 2017, 01:34:48 am
Hi! I checked the version. So i was on 2.5.8, i updated to 2.5.8.1 and the warning persist but i noticed a new information about it:

SendMessage cannot be called during Awake, CheckConsistency, or OnValidate
UnityEngine.MeshFilter:set_sharedMesh(Mesh)
tk2dSprite:OnValidate() (at Assets/TK2DROOT/tk2d/Code/Sprites/tk2dSprite.cs:118)
UnityEditor.PrefabUtility:InstantiatePrefab(Object)
tk2dRuntime.TileMap.BuilderUtil:SpawnPrefabsForChunk(tk2dTileMap, SpriteChunk, Int32, Int32, Int32, Int32[]) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapBuilderUtil.cs:128)
tk2dRuntime.TileMap.BuilderUtil:SpawnPrefabs(tk2dTileMap, Boolean) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapBuilderUtil.cs:202)
tk2dTileMap:Build(BuildFlags) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:326)
tk2dTileMap:Awake() (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:121)
UnityEngine.Object:Instantiate(GameObject)
SceneController:changeMap(GameObject, Boolean) (at Assets/Scripts/proto_scripts/SceneController.cs:117)
<goMap>c__Iterator3:MoveNext() (at Assets/Scripts/proto_scripts/SceneController.cs:93)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

it seems that the problem come from one of my scripts when i try to instanciate a tilemap from ressources :-p i know now it is very bad to do like this but i'am a very very noob coder :-p
i have to modify this part to use assetbunble instead as it is recommended. but i don't know if it will correct anything about the warning. to be sure, i also tried to open again the project on unity 5.6 and (except some asserts from migration) the warning disappear ;( ...
Title: Re: unity 2017
Post by: unikronsoftware on July 26, 2017, 04:55:29 pm
I don't have any tests that instantiate this from resources, I'll take a look for you.
Title: Re: unity 2017
Post by: unikronsoftware on July 26, 2017, 11:29:48 pm
Hi there,

Just investigated this and found a bug with tk2d in Unity 2017.1. I have fixed it and will issue an update.
ps. Instantiating from a prefab in resources works fine :)

Fix here - http://2dtoolkit.com/forum/index.php/topic,5511.0.html
Title: Re: unity 2017
Post by: babarzor on July 27, 2017, 04:56:43 pm
Great! thx a lot! :-)
Title: Re: unity 2017
Post by: babarzor on August 02, 2017, 04:03:10 am
Hi! Actually i don't know how to find the lastest version of 2dtoolkit. :-p on unity store is still the 2.5.8.1
Title: Re: unity 2017
Post by: unikronsoftware on August 02, 2017, 10:11:15 am
I will be updating the Unity asset store version tonight.

If you want to get it from here, register your copy following instructions below:
http://2dtoolkit.com/forum/index.php/topic,34.0.html