- Home /
#define directive in UnityScript
For whatever reason, I am unable to add the #define directive in my UnityScript code.
The script compiles without the directive, but with the directive, it gives the error BCE0044: expecting 'p', found 'd'.
on the line of the directive, referencing the second character of the line. The code I have is this:
#define KEY_NOSCRIPT
The line is located at the top of my script right after a #pragma strict
. I have checked, and the order of the directives does not matter, nor does the presence of #pragma
.
Is the #define
directive supported in UnityScript?
Answer by Eric5h5 · Apr 06, 2012 at 04:37 AM
It's not supported in Unityscript.
Didn't know that. That's another good reason to forget JS and use C# ins$$anonymous$$d.
Were a couple of years later, so I a, wondering if got supported in a update?
However even when you can't use #define
you can now define such constants "globally" for your whole project in the player settings dialog. It's called "Scripting Define Symbols". See the Platform Dependent Compilation page for more details.
Your answer
Follow this Question
Related Questions
What should i learn for unity C# or UnityScript? 4 Answers
Closure does not work in Unity JS functions? 1 Answer
Collide detection with tag [JS] 0 Answers
Creating a dynamic array of objects of custom class 1 Answer
Make a command run only once 1 Answer