Hello Guest

Author Topic: Merging two tk2d games  (Read 6303 times)

shortter

  • Newbie
  • *
  • Posts: 3
    • View Profile
Merging two tk2d games
« on: June 28, 2012, 04:17:32 pm »
I'm having trouble merging several games into one unity 3.5.2 project. I have 3 games that use tk2d and I export them into packages. Next step I import them into a new project. Every time a new package is imported, it severs the connections between the previous game's objects to the tk2d scripts. So although the path remains the same, the links are broken and I am left with non functional "pink" games.
It's really Important that I can automate this. In the future we plan on having many unity games and I need to get a smooth and quick process.
This looks like a namespace conflict, Any suggestions?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Merging two tk2d games
« Reply #1 on: June 28, 2012, 05:52:17 pm »
This should work fine - we do something like this fairly frequently. After importing, all you'll need to do is rebuild the index (2D Toolkit > Rebuild Index).
A few things to help troubleshoot this.

1. Make sure you're using the same version of 2D Toolkit on both machines.
2. Make sure you've also not moved any of the files outside the interface (this will break the GUIDs internally in Unity, and should be avoided in all circumstances)
3. Make sure the GUIDs are the same on the scripts - turn on Edit > Project Settings > Editor > Version Control = Meta Files, and compare the meta files on the objects. If they are different, let me know and I'll describe how to fix them up. (It is painful, but doable)

shortter

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Merging two tk2d games
« Reply #2 on: June 29, 2012, 09:19:00 pm »
Both projects were developed separately and although I could get the tk2d to be the same version on both, the GUID's are different.
I tried a binary search replace but it seems to corrupt the project. Will I have to manually go through the scene and update all the script references?


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Merging two tk2d games
« Reply #3 on: June 29, 2012, 09:31:48 pm »
Any idea how are the GUIDs different in both? Were they files moved/copied outside Unity? Do the demo scenes work in either/both?

Its the script references that need to be fixed up - best fix it up on the one which doesn't match the distribution. You don't HAVE to do it manually - you can switch to text serialization, and then do a find-replace in a text editor. A lot quicker and less painless than messing about with the GUIDs.

On some objects, for example the sprite collection objects, it may be easier to do it by hand.

shortter

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Merging two tk2d games
« Reply #4 on: July 05, 2012, 08:18:44 pm »
You saved me, text serialization did it.  I just had to search replace all the GUID's so that they match on both projects and then importing worked!
This is clearly a Unity thing and not tk2d.
Are you going to Unite Amsterdam?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Merging two tk2d games
« Reply #5 on: July 05, 2012, 08:41:46 pm »
Glad that sorted it out :)

Yup, I'll be at Unite Amsterdam.