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

Pages: [1] 2 3 ... 6
Support / Re: 2d Toolkit deprecated on store
« on: April 28, 2020, 04:54:41 pm »
Do you mind sharing where you had to include null checks? I'm not using Unity 2019 yet, but probably will upgrade to it in the next few months. Thanks!

Sure thing:

Code: [Select]
Line 381 (replace):  public int Count { get { return inst == null ? 0 : inst.spriteDefinitions.Length; } }
Line 578 (replace):  platformSpecificData?.Init(); // awake is never called, so we initialize explicitly

Code: [Select]
Line 69 (insert):  if (collectionInst == null) return;

Code: [Select]
Line 262 (insert):  if (CurrentSprite == null) return;

Code: [Select]
Line 954 (replace):  if ( Collection != null && Collection.inst != null && GetComponent<Renderer>() != null&& GetComponent<Renderer>().sharedMaterial == null && Collection.inst.needMaterialInstance) {

I am just using Sprites and Sliced Sprites. You might need more if you touch other artefacts also.

Support / Re: 2d Toolkit deprecated on store
« on: April 27, 2020, 08:38:05 pm »
Your explanation makes totally sense, but maybe 2019.3 fires different events or other triggers that makes tk2d get control during the build. It runs into null pointers in like 5-6 different places for every missing index file during the build (which doesn‘t affect the result, though, but is very annoying), however I now just included null pointer checks in those places and now it runs w/o any more complaints ;-)

Support / Re: 2d Toolkit deprecated on store
« on: April 25, 2020, 08:58:11 am »

sorry, seems like the forum isn't sending notifications any longer, so I missed your response.
Your code works in principle, however tk2d goes frenzy with lots of missing reference exceptions during the build once part of it's index files where moved out. No clue how this affects the overall build and haven't found how to make tk2d more resilient (and silent) towards a missing platform index file (w/o on the other hand supressing valid errors). It would be great if we'd get some information on where the loop lives that iterates over platforms to move them over to the build folder.Haven't spotted it so far, but then we could just except the unwanted platforms in that loop.

For the camera fix: the way tk2d determines the editor game window size does no longer work, however there is an official way of determining it now, so you just have to replace Editor__GetGameViewSize function in tk2dcamera.cs by:

Code: [Select]
public static bool Editor__GetGameViewSize(out float width, out float height, out float aspect) {
  Vector2 screenSize = Handles.GetMainGameViewSize();
  width = screenSize.x;
  height = screenSize.y;
  aspect = (float)width / (float)height;
  return true;

Support / Re: 2d Toolkit deprecated on store
« on: April 06, 2020, 02:50:53 pm »
Still happily using it with Unity 2019.3 (just a minor fix for Editor required, which was straightforward and easy). No real alternative to the great platform support (20% of my Android user base still needing a 2x resolution).

That being said: for iOS I could well just go with 4x graphics. What would be a good way to not deliver 2x atlases for iOS, but 2x and 4x for Android?

Support / Re: Issues with Unity 2018
« on: May 15, 2019, 12:13:58 pm »
Reporting in on the latest 2019 build with Beta3, everything works so far on my end. Great work!


If i hit Save in a scene i get this error, but this hasn't stopped the game from running.

Code: [Select]
InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
System.Collections.Generic.List`1+Enumerator[T].MoveNext () (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
tk2dIndex.GetSpriteCollectionIndex () (at Assets/TK2DROOT/tk2d/Editor/tk2dIndex.cs:76)
tk2dSpriteCollectionBuilder.RebuildOutOfDate (System.String[] changedPaths) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionBuilder.cs:147)
tk2dSpriteCollectionTextureWatcher.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at Assets/TK2DROOT/tk2d/Editor/Sprites/tk2dSpriteCollectionTextureWatcher.cs:37)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
UnityEditor.AssetPostprocessingInternal.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:633)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:144)

I get the same issue when commiting a sprite collection now. Not sure whether this is also a cause of the fact that I cannot change platform support w/o messing up the consuming sprite objects. I wanted to strip lowres support now (as there is only a very minor fraction still needing it), however when I remove a platform from settings and re-commit, I am getting the above error and the sprites referring to that collection are no longer set to a valid value.

Releases / Re: 2D Toolkit BETA
« on: April 06, 2019, 07:04:12 am »
Couldn‘t you just copy an existing one, clean it up and reuse — for the time being?

Releases / Re: 2D Toolkit BETA
« on: March 28, 2019, 08:17:48 pm »
Yeah, noticed the same, however seemingly only the message settings seem not to set the dirty flag. I work around this by changing some other switch back and forth, each time saving. Then also the message settings will be persisted properly.

Releases / Re: 2D Toolkit BETA
« on: March 22, 2019, 09:35:22 pm »
The sprite in your scene comes from the generated atlas. This part is not the issue, as the atlas is generated once you commited the added sprites. The source metadata (the sprite you added to the collection and the settings you chose for it) is — still seemingly sometimes — not properly persisted in the collection prefab. That’s why it’s missing on the next opening of the editor. So it’s a design time issue, not a runtime one.

I have to say that it’s much better now if you take special care. At least there is a high chance you eventually end up with what you need (especially working with multiple res.-platforms). I’d prefer if we were back at the works-always-no-worries state of a few years back, but it was worse when I had to keep a list of newly added sprites to re-add them whenever another change was required. That was extremely error-prone and annoying. I’d probably give tk2d a pass by now if I’d not have “fallen in love” with so many of the great detail features it has...

Releases / Re: 2D Toolkit BETA
« on: March 22, 2019, 05:40:02 am »
This should be fixed with this Beta (open sprite collection through new „Edit...“ funtion in tk2d menu).

However, I had one or two occasions where it still happened again and added sprites where missing on later opening. It seems not to be 100% stable yet. However I couldn‘t reproduce it and find a stable root cause to report. For now I just check back immediately to not later forget what needs to be in the collection, and it is ok most of the time!

Please note that there is still one other issue in case you use platform support. If you change source graphics on the filesystem, Unity just updates the platform collection that is currently selected for the editor. The other(s) will be messed up. Make sure you finally re-check all supported resolutions explicitly and re-commit them in tk2d collection editor, if required.

Regards, habitoti

Support / Re: Issues with Unity 2018
« on: February 18, 2019, 04:01:35 pm »
I was surprised I hadn't had too severe issues overall with tk2d after lately upgrading to Unity 2018. Until I had to add a another graphic to a sprite collection  :(

Will there be any new tk2d version at all that'll work with 2018 and the new prefab system? If I would have to throw out tk2d completely this would be a severe setback for my app -- if it would be doable at all. My app is so heavily invested in tk2d that I can hardly imagine to migrate to Unity native...

Support / Re: Removing a platform for standalone desktop builds
« on: January 19, 2015, 07:08:54 pm »
There is also a tk2dSystem file in there that seems to also list all these references...does this also need to be cleaned up?


I've found one font atlas that caused the whole trouble and prevented the processing of everything else after the platform switch. After opening that atlas in the collection editor and re-committing it, everything went well. So seemingly just some glitch in the course of platform switching...

Thanks, habitoti

Support / Removing a platform for standalone desktop builds
« on: January 17, 2015, 07:36:29 pm »

I have made a lot of efforts to arrange my textures in 2x and 4x atlases (lots!) for the mobile targets. Now I am doing a standalone build for desktops (PC/MAC/LINUX) and would actually just need the 4x since there are no issues for a PC in dealing with the larger textures. To reduce the app size I want to only deploy the 4x platform atlasses, but for obvious reasons I can't delete the 2x atlasses from the project.  Is there any easy way to "switch them off" for just this output channel? Since they are not within a resource folder, I suppose tk2d decides to take them and put them into the build, so mabye there is an easy way to have it suppress this for desktop builds.

Thanks, habitoti

was there any resolution for this? I am just experiencing the same...
Thanks, habitoti

Showcase / Café International, classic boardgame adaptation
« on: October 15, 2014, 07:22:55 am »

having developed a native iOS version first, I started to port Café International to Unity, heavily using Toolkit 2D.
An Android version is now released (Google PlayStore, Amazon Store).

Pages: [1] 2 3 ... 6