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

Pages: [1]
1
Support / Re: Issues Setting tk2dSpriteCollection At Runtime
« on: September 04, 2014, 01:55:59 pm »
Great, I will do just that. Thanks!

2
Support / Re: Issues Setting tk2dSpriteCollection At Runtime
« on: September 03, 2014, 03:51:42 pm »
I'll also add (not sure how relevant this may be) that the Sprite Collections are being changed in a Start() method.

3
Support / Re: Issues Setting tk2dSpriteCollection At Runtime
« on: September 03, 2014, 03:50:55 pm »
I've been attempting to reproduce this all morning on a fresh project but haven't had any luck.

In my current project, however, I have narrowed it down to one line. If I comment out Line 85 in tk2dEditorSpriteDataUnloader.cs...

Code: [Select]
DestroyInternalObjects( allObjects.ToArray() );
...then the issue goes away. This leads me to believe that the issue only happens when running in the editor. Does this help at all?

EDIT: Just verified that it is only happening when running in the editor.

4
Support / Issues Setting tk2dSpriteCollection At Runtime
« on: September 02, 2014, 04:11:12 pm »
Hi,

I'm having an issue changing the tk2dSpriteCollection of a tk2dSprite at runtime.

The tk2dSpriteCollectionData object is in the Resources folder and loaded at runtime using Resources.Load (I have also tried dragging them into public variables in the inspector, but had the same results).

When I call the SetSprite function and pass the tk2dSpriteCollectionData object to it, the sprite correctly changes to the new collection. When this is done, however, other sprites in the scene (that are using completely different sprite collections) lose their material references. The material on these sprites changes to "Default-Diffuse (Instance)" instead of the "tk2dInternal$.Material_..." material. This only happens to some sprites; others in the scene that reference the same collection are fine. The affected sprites are not random, but they appear to have no connection. In addition, I receive numerous "Shader wants normals, but the mesh  doesn't have them" errors in the log.

If I call ForceBuild on all sprites in the scene after changing the sprite collection the sprites seem to fix themselves, but I still get the "Shader wants normals" errors. This issue only occurs when changing the sprite collection of sprites at runtime, otherwise the scene works properly.

Not sure if this is relevant, but I am changing multiple sprite collections in the same frame.

Any assistance would be greatly appreciated.

Pages: [1]