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

Pages: [1]
1
Support / Re: NullReferenceException in tk2dTileMapBuilderUtil
« on: February 05, 2015, 09:50:37 pm »
Thanks.

2
Support / Re: How do I get a reference to my tile map?
« on: February 05, 2015, 04:43:18 pm »
If you need a TileMap, in your game object create a field:

public tk2dTileMap myTilemap;

and assign the tilemap in the unity editor.

This will give you the tilemap. Then use the methods of the object to get tiles.

3
Support / NullReferenceException in tk2dTileMapBuilderUtil
« on: February 05, 2015, 04:08:34 pm »
Hi,

Suddenly I started getting this error. (possibly after a collider update to one of the prefabs).

NullReferenceException
tk2dRuntime.TileMap.BuilderUtil.HideTileMapPrefabs (.tk2dTileMap tileMap) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMapBuilderUtil.cs:280)
tk2dTileMap.ClearSpawnedInstances () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:225)
tk2dTileMap.Build (BuildFlags buildFlags) (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:304)
tk2dTileMap.EndEditMode () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:526)
tk2dTileMap.Awake () (at Assets/TK2DROOT/tk2dTileMap/Code/tk2dTileMap.cs:117)
UnityEditor.DockArea:OnGUI()


After debugging the code

for (int i = 0; i < instListCount; ++i) {
            int x, y, layerIdx;
            GameObject instance;
            tileMap.GetTilePrefabsListItem(i, out x, out y, out layerIdx, out instance);
            
            // Is it already IN the list for some reason?
            if (!instExists) {
               int tileId = (x >= 0 && x < tileMap.width && y >= 0 && y < tileMap.height) ? tileMap.GetTile(x, y, layerIdx) : -1;
               if (tileId >= 0 && tileId < prefabs.Length && prefabs[tileId] != null) {
                  instExists = true;
               }
            }
            
            if (instExists) {
               tileX.Add(x);
               tileY.Add(y);
               tileLayer.Add(layerIdx);
               tileInst.Add(instance);

               tk2dUtil.SetTransformParent(instance.transform, tileMap.PrefabsRoot.transform);
            }
         }

in this line: tk2dUtil.SetTransformParent(instance.transform, tileMap.PrefabsRoot.transform);
instance is null.

How to find a broken tile ?

Pages: [1]