Hi there,
I need to declare a script as a var. I am used to JS, however I need to use C# as it is only that which is compatible to iTweenPath (So I think, please correct me if I am wrong).
this…
public heroManagerScript heroManagerData;
does not work.
How should I declare it?
Thanks.
heroManagerScript heroManagerData = gameObject.GetComponent();
Thanks
But I am getting this error.
Assets/Scripts/btnITweenSwitchPath.cs(9,9): error CS0246: The type or namespace name `heroManagerScript’ could not be found. Are you missing a using directive or an assembly reference?
If heroManagerScript is a JS script then you need to make sure it compiles before the C# script. See here.
Ok so I have gathered from the link that all scripts in the Editor folder are compiled last. As a result I created an Editor folder, placed said script inside, separate from all other, predominently js scripts. It removes the error, however, when I go to attach this script, in the editor folder to an object I get this message in a pop up window…
Can’t add script behaviour btnITweenSwitchPath because it is an editor script. To attach a script it needs to be outside the ‘Editor’ folder.
:?
Scripts in the Editor folder are only compiled for the Editor and aren’t included in your build. If it’s not an Editor script then it shouldn’t be in there.
hmm.
ok, so everything I am dealing with here are basic behavior scripts. No custom shaders, processors and the like. Just “make this move here” type stuff. I am using this one C# for iTween Path, which I believe will only except C#. So I need it to be separated from the rest, so it is compile last. Do you know off hand which way is best? There are a few choices here.
am just unsure as to what my scripts are? I am just unclear how to separate them into working folders, that will call in order and what those folder titles should be despite your link.
Not sure where your confusion is. If the JS script needs to compile before the C# script then the JS script should be in a folder that is compiled earlier in the process. So Standard Assets or Plugins is probably your best bet. Doesn’t really matter what your script is doing - if it isn’t an Editor script then it can’t be in the Editor folder.
Well, when I put it in PlugIns or the StandardAssests folder I get a gaggle of errors all relating to iTween.
error:
Assets/Standard Assets/Scripts/xScript.js(137,103): BCE0005: Unknown identifier: ‘iTween’.
That’s because it gets compiled before iTween.
You should be able to move iTween to Plugins or Standard Assets and use UnityScript for your project.
I am sorry. I am not sure what you mean.
quote:
You should be able to move iTween to Plugins or Standard Assets and use UnityScript for your project.
iTween is in my PlugIns folder.
Then you should be able to access it in UnityScript.
From the iTween website:
I have been getting errors is JS when using iTween Path, not iTween. Going to try again.
Thanks.
Wow.
I feel like a weight has been lifted. I am not sure how I thought only C# worked in iTweenPath, but I swear I read it, then JS was giving it fits earlier. Clearly I was doing something wrong.
Thank you.
One thing tho, does anyone know how to insure that I can see, and grab hold of the iTweenPath node, transforms? Mine for some reason are non existent. I can only manipulate positions via the inspector. Thanks.
I have seemed to have tried everything. The issue now is not C# or JS, it is simply I am thinking a compile issue… I think. I have no C# scripts in my Scripts Folder.
My Project Pane…
Project Pane/Assets Folder (default. not actually there)
Art
Plugins
Standard Assets
Scripts
Prefabs
Unitile(Unity Asset)
My iTweenPathEditor.cs which is in Plugins/ITweenPath/Editor is the source of the error.
I am thinking from what i have gathered and been told that my iTweenPathEditor needs to compile after the scripts I have written call for it. However I have moved my scripts folder into all the above folders, Plugins, StandardAssets… all combinations give me errors. I have created other folders too and nothing is working. Can some one please tell me what I am doing wrong?? The game compiles in UNity but will not build for the iOS.
Isn’t iTweenPathEditor an Editor extension class? If so, you can’t include it in a build.
So what does that mean?
I mean I reeeeeallly want to use iTweenPath.
It means it’s an Editor extension and can’t be included in a build…