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

Pages: [1]
1
This GUI/Text Shader tip is gold! Exactly what I needed too!

Thanks for the tip, marcosramos!

2
Support / Re: Change TileMap graphics dynamically
« on: February 27, 2014, 07:51:23 pm »
It looks like the tiles are being atlases differently. If you disable trimming in both, the likelihood is the textures will be the same, and as such will be interchangeable.

There is always the option of rebuilding the tile map entirely but thats slow.

That was it! And it makes perfect sense. Since my tilemap was not "similar", but a version of entirely black, probably some tiles got cut by the trimming algorithm. Now everything is perfect. Only care I had to take was not to lose the reference to the original texture.

Also noteworthy, didn't need to rebuild!

Thanks a lot!

3
Support / Re: Change TileMap graphics dynamically
« on: February 27, 2014, 03:19:25 pm »
Doing the suggested I could load tiles but they were loaded in the wrong order.

If I change the sprite collection in the tilemap via the editor, I "get" the effect I want, the tiles match. Any suggestions?

Thanks again.

4
Support / Re: Change TileMap graphics dynamically
« on: February 27, 2014, 03:18:32 am »
Code: [Select]
public tk2dTileMap tileMap;
public tk2dSpriteCollectionData thingYouWantToChangeItTo;

tileMap.SpriteCollectionInst.materialInst[0].mainTexture = thingYouWantToChangeItTo.material.mainTexture;

Hi! I tried doing the above to change the tilemap at runtime but couldn't succeed. I keep getting this message:

Code: [Select]
UnassignedReferenceException: The variable material of 'tk2dSpriteCollectionData' has not been assigned.
You probably need to assign the material variable of the tk2dSpriteCollectionData script in the inspector.
UnityEngine.Material.GetTexture (System.String propertyName) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/ShaderBindings.cs:220)
UnityEngine.Material.get_mainTexture () (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/ShaderBindings.cs:166)
...

When the code calls this line:

Code: [Select]
        tileMap.SpriteCollectionInst.materialInsts[0].mainTexture = black.material.mainTexture;

What can I do? I also need to change the tiles at runtime.

While in the topic, is it possible to apply shaders to one layer?

Thanks in advance!

Pages: [1]