Hello Guest

Author Topic: The type or namespace name `tk2dSprite' could not be found.  (Read 7511 times)

murkantilism

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
The type or namespace name `tk2dSprite' could not be found.
« on: November 11, 2013, 09:16:13 pm »
I've been using TK2D for over a year now, never had this problem before. I cannot script anything related to TK2D without getting:

Quote
The type or namespace name `tk2dAnimatedSprite' could not be found. Are you missing a using directive or an assembly reference?

When I created the project, I imported TK2D just like I have before. I've downloaded the latest version, re-imported TK2D, closed and opened the project numerous times, Rebuilt the Index, Checked Integrity - everything is supposed to work fine.

I can create Sprite Collections and Animations, I can create individual Sprites in the scene, but for some reason the second I write "public tk2dSprite mySprite;" I get errors and cannot reference TK2D at all.

Any ideas/solutions? The only problem I can think of is that this project is synced with GitHub and SVN enabled, but I cannot imagine why that would mess with TK2D scripting at all. Going to try creating a new project with TK2D and dragging all my assets in.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: The type or namespace name `tk2dSprite' could not be found.
« Reply #1 on: November 11, 2013, 09:28:38 pm »
Are you using Javascript? If so, did you run Setup for JS after importing?

murkantilism

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: The type or namespace name `tk2dSprite' could not be found.
« Reply #2 on: November 11, 2013, 09:39:11 pm »
Nope, I'm using C#

murkantilism

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: The type or namespace name `tk2dSprite' could not be found.
« Reply #3 on: November 11, 2013, 09:40:27 pm »
The line that's throwing this error is literally just:

Code: [Select]
public class RiddleScript : MonoBehaviour {
    public tk2dSprite bigSphinx;
}

murkantilism

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: The type or namespace name `tk2dSprite' could not be found.
« Reply #4 on: November 11, 2013, 09:45:05 pm »
Just for shits and giggles I ran the "Setup for JS" tool, now all of a sudden I can reference tk2d stuff from MonoDevelop, the errors are gone now.

There isn't a single JS script in the entire project though - why did that fix the problem for my C# scripts?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: The type or namespace name `tk2dSprite' could not be found.
« Reply #5 on: November 11, 2013, 09:46:51 pm »
No idea! Did you move the default installation directory anywhere?

murkantilism

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: The type or namespace name `tk2dSprite' could not be found.
« Reply #6 on: November 11, 2013, 09:49:03 pm »
Nope, when importing TK2D I just went with the default location, didn't touch anything to do with installation directories. Very odd, there must have been some miscommunication between Unity, MonoDevelop and TK2D so when I ran the Setup for JS tool it re-established these missing references.