Hello Guest

Author Topic: tk2dExternal does not exist  (Read 23251 times)

pedrommlr

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
tk2dExternal does not exist
« on: June 07, 2013, 03:04:04 am »
I'm having a bit of a problem with the 2.0 version 2d Toolkit.

I get the message tk2dEditorSkin.cs(14,25): error CS0103: The name `tk2dExternal' does not exist in the current context

It's like Unity can't find the dll, but I see it right there in the editor folder.

Any ideas?

int64

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: tk2dExternal does not exist
« Reply #1 on: June 07, 2013, 07:36:42 am »
Before updating tk2d to 2.0 version, I deleted "tk2d" folder in "Assets/Plugins" directory. After that, I reinstalled tk2d 2.0 with no errors.

P.S.: sorry for my bad English

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dExternal does not exist
« Reply #2 on: June 07, 2013, 09:12:42 am »
Its hard to tell whats going on without actually looking at it.
1. Have you moved the files from the default locations?
2. Have you tried restarting Unity?

pedrommlr

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: tk2dExternal does not exist
« Reply #3 on: June 07, 2013, 06:41:55 pm »
I have tried deleting TK2DROOT from the assets folder and installing from scratch. That didn't work.

And yes, I've moved the TK2DROOT folder to a Plugins folder, otherwise Unity simply ignored the 2dtk plugin.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dExternal does not exist
« Reply #4 on: June 07, 2013, 07:10:28 pm »
You shouldn't move the tk2dROOT folder to plugins. I take it you're using JS? Thats what the 2D Toolkit > Set up for JS menu option is for - it moves the correct files into Plugins. Moving editor scripts into plugins does really nasty things, but sadly thats how Unity works :(

If your project isn't too big, the easiest way to fix this is:
1. In your project, shift select everything that isn't tk2d. Export a unity pacakge.
2. Create new project, import tk2d. Run Setup for JS.
3. In the new project, import unitypackage from #1.

If its too big then you'll have to manually move the files back to the default locations, but you can skip the ones which Setup for JS moves for you. Do step #2, then make a note of what goes where. Everything should work when they're in the right folders.

pedrommlr

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: tk2dExternal does not exist
« Reply #5 on: June 07, 2013, 09:31:11 pm »
Ah yes! That cleared the errors, great!

But now there's another issue. All my prefabs now have this message where 2dtk scripts used to be:

http://cl.ly/image/1o0k1Y0p0C2Y

Including collections and all...

pedrommlr

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: tk2dExternal does not exist
« Reply #6 on: June 07, 2013, 09:33:03 pm »
Also, running the integrity check now shows a lot of errors like
"File GUID does not match: Assets/Plugins/tk2d/Code/Sprites/tk2dSpriteCollectionData.cs"

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dExternal does not exist
« Reply #7 on: June 08, 2013, 01:12:43 pm »
So if you get "File GUID does not match" it means you have done something to break your project metadata.

Common ways this happens is -
1. Moving files outside Unity. This is one of the key things in Unity - never move files in a project from outside Unity. (http://wiki.unity3d.com/index.php/Moving_and_Copying_Unity_Assets)
2. Sharing Unity projects between computers via dropbox / etc. without meta files turned on.
3. Using version control without meta files turned on.

Once metadata is broken, as far as I'm aware, it can't be fixed.
You can still update tk2d, but you'll have to do it manually. I"m assuming you haven't run the "Setup for JS" script and that you're using c#.

1. In your exiting project, enable meta files, close down Unity, and make a zip backup of Assets & ProjectSettings. Libraries isn't needed with meta files on. You'll notice a LOT of .meta files in there.
2. Import tk2d 2.0 into the project, letting it overwrite what it needs to. Restart Unity, and fix any errors as described in the migration guide.
http://unikronsoftware.com/2dtoolkit/doc/2.00/migration_guide.html
3. Hopefully your project would have updated fine.


If you wish to do this, but you've run Setup For JS - you should do this instead.

1. Create a new project, do NOT turn on meta files in this project.
2. Import 2D Toolkit 2.0 into this new project, and then after its imported properly, run Set up for JS.
3. Shut down Unity, and browse to that folder.
4. Copy the contents of the Tk2DRoot folder and its subfolders, taking care not to overwrite the meta files in your original project.
5. Copy the contetnst of the Plugisn folder and its subfolders, again taking care not to overwrite meta files in the original project.
6. Fix any compatibility issues as in the migration guide.

Let me know if you run into any more issues - unfortunately your project is now "broken" compared to the default 2D Toolkit project, and its going to be tricky updating.


Note:
If you have messages showing "associated scripts can't be found", then you will need to drag the appropriate scripts in to fix it. If you're going to do this, you might as well delete all the tk2d files, reimport the package and fix them then once and for all. That WILL actually fix the meta files and you'll then be able to upgrade the normal way.

Vico92

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: tk2dExternal does not exist
« Reply #8 on: March 30, 2015, 11:47:34 am »
I'm having identical problem here since I've updated to Unity 5.0, I've just updated 2DToolkit to 2.5.1 too but still get error :
****/MyProject/Assets/TK2DROOT/tk2d/Editor/tk2dEditorSkin.cs(25,25): Error CS0103: The name `tk2dExternal' does not exist in the current context (CS0103) (Assembly-CSharp-Editor)

While It's not blocking development (still can run app on editor/device) it's annoying to get focused on that error each build… How can I manually add this entry, pls?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dExternal does not exist
« Reply #9 on: March 30, 2015, 12:41:53 pm »
It is likely that the files have been moved to different directories and the update can't see it. Did you use SetupforJS / move the tk2d files from the default directories?

Vico92

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: tk2dExternal does not exist
« Reply #10 on: March 30, 2015, 01:06:44 pm »
I do not use JS and I didn't activated JS setup nor moved files. Every 2dtk files are located in the TK2DROOT created at import.
To me it's not related to project's update since it also occurs with fresh new project & fresh import of 2DToolkit.
But could be something on monodevelop side?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dExternal does not exist
« Reply #11 on: March 30, 2015, 01:28:48 pm »
That is very bizarre. I just imported tk2d 2.5.1 (from forum) into a new Unity 5 project and I don't see it. Can you zip up and email a broken project to support at unikronsoftware.com?

Vico92

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: tk2dExternal does not exist
« Reply #12 on: March 30, 2015, 03:17:51 pm »
Done. I've sent the project by email + a dropbox link, just in case.

I noticed there's no more -tk2d.asset file generated, is that correct?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dExternal does not exist
« Reply #13 on: March 31, 2015, 10:33:05 pm »
Replied to your email.

yo_milo

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: tk2dExternal does not exist
« Reply #14 on: April 08, 2015, 07:33:53 pm »
I am having the same problem... I even created a fresh new project, just to import 2D Toolkit, same error...