- Home /
Unity cuts off URLs on a #error preprocessor
I'm writing on some Unity modules.
Some of them depend on each other so I want to print out an error including the URL where to get the missing module(s).
I tried this:
#if !THIS_MODULE
#define THIS_MODULE
#endif
#if !REQUIRED_MODULE
#error This Module requires the RequiredModule module
#error Please get it from "https://example.com"
#endif
If the required module is missing the first line just prints out in the Unity3D console as expected
error CS1029: #error: 'This Module requires the RequiredModule module'
but the second line only prints
error CS1029: #error: 'Please get it from "https:'
I tried it with and without
"
and'
this din't change anything but adding the "
or '
to the ouput
I tried it like
#error Please get it from "https:\/\/example.com"
but than it printed
#error: 'Please get it from "https:\/\/example.com"'
How can I print an URL corrctly using the #error
preprocessor in Unity?
It works in VisualStudio (and e.g. here) but in the Unity console the URL is always cut off so I think it is a Unity thing.
So I think it might be possible that Unity does this on purpose in order to prevent bad people from placing any malicious or spam URLs into precompiled .dll
s so you would not be able to disable them from beeing posted in the editor.
Your answer
Follow this Question
Related Questions
Can you make a 3DS game with Unity? 2 Answers
System.UnauthorizedAccessException 1 Answer
Simultaneous Unity & Command Prompt? 0 Answers