2D Toolkit Forum
2D Toolkit => Support => Topic started by: murkantilism 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:
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.
-
Are you using Javascript? If so, did you run Setup for JS after importing?
-
Nope, I'm using C#
-
The line that's throwing this error is literally just:
public class RiddleScript : MonoBehaviour {
public tk2dSprite bigSphinx;
}
-
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?
-
No idea! Did you move the default installation directory anywhere?
-
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.