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

Pages: [1]
Releases / Re: 2D Toolkit
« on: September 16, 2019, 07:15:23 pm »
Is there an update to work on 2019.3?

"tk2dCamera.GetGameViewSize - has a Unity update broken this?
This is not a fatal error, but a warning that you've probably not got the latest 2D Toolkit update.

System.NullReferenceException: Object reference not set to an instance of an object
  at tk2dCamera.Editor__GetGameViewSize (System.Single& width, System.Single& height, System.Single& aspect) [0x00021] in D:\Games\Green Sauce Games\Tales of the Orient - The Rising Sun\Assets\TK2DROOT\tk2d\Code\Camera\tk2dCamera.cs:371
tk2dCamera:Editor__GetGameViewSize(Single&, Single&, Single&) (at Assets/TK2DROOT/tk2d/Code/Camera/tk2dCamera.cs:430)
tk2dCamera:GetScreenPixelDimensions(tk2dCamera) (at Assets/TK2DROOT/tk2d/Code/Camera/tk2dCamera.cs:709)
tk2dCamera:UpdateCameraMatrix() (at Assets/TK2DROOT/tk2d/Code/Camera/tk2dCamera.cs:782)
tk2dCamera:OnEnable() (at Assets/TK2DROOT/tk2d/Code/Camera/tk2dCamera.cs:275)

I haven't tested this extensively, but a quick workaround is to update the Editor__GetGameViewSize function with this:

Code: [Select]
public static bool Editor__GetGameViewSize(out float width, out float height, out float aspect) {
width = Screen.width;
height = Screen.height;
aspect = (float)width / (float)height;
return true;

This will not work if you select "Free Aspect" - you must select an explicit resolution in the editor.

It does seem to work with any chosen, explicit resolution. I have not checked to see if this has any negative effects, use at your own risk!

Also worth noting that it may not work with how you have your tk2d camera(s) set up!

Note that this error happens in Unity 2019.3+ because Unity removed UnityEditor.GameView.GetMainGameView. As Unity 2019.3 is still in beta, most plugin authors likely haven't looked into this issue. I'm thinking we'll see a more formal solution from the community and/or other plugin authors after 2019.3 is officially released, at which point a proper solution can hopefully be implemented.

Support / Re: 2D Toolkit No Longer Supported?
« on: September 16, 2019, 04:06:00 pm »
Yes please! Happy to fix up if I can get a repro :)
support at unikronsoftware.com

Awesome, thanks! I just sent a repro project to you, I was actually able to make the issue occur with a new project in Unity 2018.4.8f1, with only 2D Toolkit imported. Hopefully that helps!

Support / Re: 2d Toolkit deprecated on store
« on: September 16, 2019, 02:36:47 pm »
Any chance of supporting Unity 2018.4? I asked about that in another thread, and you mentioned that you would support up to Unity 2018.4, just double-checking!

2018.4 is important because it's the LTS (Long Term Support) release, and Unity will be properly supporting it with bug fixes, etc. for nearly two more years, which will give a lot of time to move over to the built-in Unity 2D.

Looking at how Unity 2017.4 has been handled for the last few years, there weren't any major changes, just bug fixes, support for necessary things like 64-bit on Android, etc. (none of which would affect 2D Toolkit, probably).

Support / Re: 2D Toolkit No Longer Supported?
« on: September 15, 2019, 04:53:44 pm »
Ran into my first issue.

My project was previously Unity 2017.4.32f1, and I updated it to Unity 2018.4.8f1 and 2D Toolkit v2.5.8.16.

If I edit a prefab that was originally created in Unity 2017, and I modify any tk2d component in the prefab, the changes are not saved in the prefab.

If I modify any non-tk2d component in the prefab after making some changes to tk2d components in the prefab, the tk2d components will be correctly saved/updated in the prefab. So the changes are being recognized, they just aren't triggering a save of the prefab.

If I remove a tk2d component, and add the same component back in (as a new component), it has the same behavior (so I don't think it's necessarily due to the update from Unity 2017 to 2018?).

So far this seems to only be an issue with the tk2d UI components, not the regular components (example: tk2dBaseSprite is fine, but tk2dUIUpDownButton has the bug). Possibly it's only components that have tk2dUIBaseItemControlEditor.cs as a base class?

Only test project I can provide would be a complete copy of my entire game, which I'm willing to do if that would help, just let me know!

Support / Re: 2D Toolkit No Longer Supported?
« on: September 12, 2019, 06:31:45 pm »
I updated one of my games to Unity 2018.4.8f1 about a week ago. I updated 2D Toolkit to v2.5.8.16 after I updated Unity.

So far everything works great! I've added sprite collections, modified existing sprite collections (added/removed/modified sprites in them), modified existing prefabs that contain tk2d components, and have been able to do everything I normally can.

The only I don't use is tk2d fonts, as I use Text Mesh Pro.

I did have to change the scripting runtime version to .NET 4.0 - it would be great if it was in the release notes and the forum thread with the v2.5.8.16 download. https://www.2dtoolkit.com/forum/index.php/topic,5607.msg25289.html#msg25289

Will report back if I do run into any issues. :)

Support / Re: 2D Toolkit No Longer Supported?
« on: July 29, 2019, 04:55:46 pm »

I am happy to support until 2018.4. As far as I am aware most of the issues affecting tk2d have been resolved in that version and the latest version
released here works fine in my tests and use cases. Of course with tk2d its an open ended toolkit and you could do so many things with it...

If you upgrade, of course be sensible - version control / backup everything and report any specific issues you're having and I'll try my best to help. Will of course need specific repros to help me find issues quickly.

That's awesome news, thanks for the update!

I'll try updating one of my games to 2018.4 soon (as a completely separate copy, just in case!) and will let you know if I run into any issues.

Support / Re: 2D Toolkit No Longer Supported?
« on: July 16, 2019, 06:35:07 pm »

I am supporting this but Unity updates are making this a very taxing affair. We have to maintain backwards compatibility above everything else and I'm currently working out how much longer it is really viable to continue supporting new Unity updates.

Eg. the prefab update is causing so many problems across the board among so many users, and especially affects us as we use prefabs in a way that is sadly affected. Eg. The 2018 issues were almost totally out of our control, and we were at the mercy of unity to fix the bug. Finding workarounds is costly for us (hours spent trying to work around Unity bugs).

Sorry if this isn't the answer you're looking for but at some point its going to tip over and not worth the effort to keep up to date with unity's constant updates.

What's the current status of 2D Toolkit with Unity 2018.4.x? Are there any show-stopping bugs?

I've got an Android/iOS game built with 2D Toolkit that is going to be released in the next few months, and it's currently using Unity 2017.4.28f1. Unity is stopping support for 2017.4 in early 2020. I expect the game to be updated for at least a year, maybe two, so I'll probably need to update to 2018.4 at some point. I'm hoping that 2D Toolkit will work properly in 2018.4, as that would give me lots of time to transition to using Unity's built-in 2D tools for my next games.

Totally understand if you decide to discontinue support in the near future - I can only imagine how frustrating it is to deal with all of the breaking changes that new Unity versions are introducing! I will say, I'm going to miss 2D Toolkit - it's been great to work with all these years, and still has some features that Unity is missing (sprite dicing being a big one!). Many thanks for all of your hard work on 2D Toolkit. :)

Support / Re: Leaving 1x assets out of builds
« on: June 25, 2018, 05:51:41 pm »
Awesome, thank you for the answer!

Got this working, using pre/post process build functions. Tested and working in Unity 2017.4.3f1. Also works with Unity Cloud Build.

Code attached for anyone else that might want to do this (as a file and embedded in the post).

Code: [Select]
using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEngine;
using System.Collections.Generic;

class LocalBuildPrePost : IPreprocessBuild, IPostprocessBuild
// this class excludes all 1x 2D Toolkit sprite collections from builds

struct Tk2dResourceToRestore
public string fileName;
public string pathAndFileNameToRestoreTo;

public Tk2dResourceToRestore(string fileName, string pathAndFileNameToRestoreTo)
this.fileName = fileName;
this.pathAndFileNameToRestoreTo = pathAndFileNameToRestoreTo;

public int callbackOrder { get { return 0; } }

private List<Tk2dResourceToRestore> mTk2dResourcesToRestore;

public void OnPreprocessBuild(BuildTarget target, string path)
Debug.Log("LocalBuildPrePost.OnPreprocessBuild for target " + target + " at path " + path);

mTk2dResourcesToRestore = new List<Tk2dResourceToRestore>();

// iterate through all tk2dResource instances in Resources/TK2D so that we can exclude any that include "@1x"
tk2dResource[] tk2dResources = Resources.LoadAll<tk2dResource>("TK2D");

foreach (var resource in tk2dResources)
// any objectReference name that contains "@1x" will get moved to /Assets temporarily (along with the corresponding .meta file), then will get moved back to Resources/TK2D
// when the build is done (so that those files aren't included in the build)
if (resource.objectReference.name.Contains("@1x"))
string resourceAssetPath = AssetDatabase.GetAssetPath(resource);
string resourceFileName = Path.GetFileName(resourceAssetPath);

string resourceMetaFileAssetPath = resourceAssetPath + ".meta";
string resourceMetaFileName = resourceFileName + ".meta";

// cache this resource and it's original path so that we can restore it after the build
mTk2dResourcesToRestore.Add(new Tk2dResourceToRestore(resourceFileName, resourceAssetPath));

// cache the corresponding meta file
mTk2dResourcesToRestore.Add(new Tk2dResourceToRestore(resourceMetaFileName, resourceMetaFileAssetPath));

// move the file from Resources/TK2D to /Assets
FileUtil.MoveFileOrDirectory(resourceAssetPath, resourceFileName);

// move the meta file from Resources/TK2D to /Assets
FileUtil.MoveFileOrDirectory(resourceMetaFileAssetPath, resourceMetaFileName);

Debug.LogFormat("Moved {0} assets out of /Resources/TK2D temporarily", mTk2dResourcesToRestore.Count);

public void OnPostprocessBuild(BuildTarget target, string path)
Debug.Log("LocalBuildPrePost.OnPostprocessBuild for target " + target + " at path " + path);
Debug.LogFormat("Moving {0} assets from /Assets back to /Resources/TK2D", mTk2dResourcesToRestore.Count);

// iterate through mTk2dResourcesToRestore and move the files back to their original location
foreach (Tk2dResourceToRestore resource in mTk2dResourcesToRestore)
// move the file from /Assets to Resources/TK2D
FileUtil.MoveFileOrDirectory(resource.fileName, resource.pathAndFileNameToRestoreTo);

Support / Leaving 1x assets out of builds
« on: June 08, 2018, 11:46:31 pm »
I've been using 1x, 2x, and 4x assets for my sprite collections.

I don't need the 1x assets for any devices any more - is there a way to leave the 1x sprite collection texture and material out of builds?

I can't simply remove all 1x assets from my project at this point as I use the 1x resolution as my design resolution, so it will mess everything up if I try to remove it from the project entirely.

Releases / Re: 2D Toolkit 2.5.6
« on: March 18, 2016, 04:52:52 pm »
I'm getting a warning in Unity 5.3.1 (EDIT: 5.3.2f1 as well) and 2D Toolkit 2.5.6.

DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.

Double clicking the warning sends me here:

Code: [Select]
public static tk2dSystem inst
if (_inst == null)
// Attempt to load the global instance and create one if it doesn't exist
_inst = Resources.Load(assetName, typeof(tk2dSystem)) as tk2dSystem;
if (_inst == null)
_inst = ScriptableObject.CreateInstance<tk2dSystem>();
// We don't want to destroy this throughout the lifetime of the game
DontDestroyOnLoad(_inst); //<--- This generates the warning!
return _inst;

Line 52 of tk2dSystem.cs

I'm getting the same warning. It happens on older versions of tk2d in Unity 5.3 and newer too.

Showcase / Letter Quest Remastered [Steam - Windows/Mac/Linux]
« on: August 13, 2015, 05:39:25 am »
Hi, I'm one-half of the two-man game dev company Bacon Bandit Games. :)

On August 5, 2015 we released Letter Quest Remastered on Steam: http://store.steampowered.com/app/373970

Scrabble meets turn-based RPG!

Spell words to battle monsters, earn gems and use them to purchase upgrades, books, special items, potions, and much more! Letter Quest is a game about using your linguistic skills to survive. It's a turn-based RPG featuring high-res artwork, clever wordplay, and a great soundtrack.

Letter Quest was originally written in Adobe Air, and released on Steam in November 2014. Adobe Air is unable to support Linux, so in January I started porting Letter Quest to Unity, and called it Letter Quest Remastered. I did the whole port over 7 months in my evenings and weekends since I have a full-time day job too.

I used 2D Toolkit, Master Audio, Spine animation software, SRDebugger, DOTween, and Steamworks.NET - I wrote everything else myself, including a lot of small tools to help with porting over 70,000 lines of code from AS3 to C#. :)

The game has been doing well on Steam - it's been featured on the front page since it was released! I also gave the game away for free to all people that owned the original Letter Quest on Steam, and that seems to have gotten a lot of attention/press, thankfully. I somehow managed to luck out and Mr. HeartRocker, a very popular youtuber in Thailand, has done a couple of videos that have a lot of views...an unexpected bonus!

A huge thank you for making 2D Toolkit - it saved me so much time! I wrote a couple of utilities for creating different-sized assets with a few clicks, and a couple of other helpers, and it's the best workflow I've ever used! I can't wait to start working on my next game!

Pages: [1]