I have a .dll
(unmanaged code) that I use in Unity. I need to add some functional in my .dll
in order to build Unity project for Android devices.
So, I need to use preprocessor functionality such as if
in my case
I tried to add it just for test in my .cpp
file
DecoderStream::DecoderStream()
{
debug_in_unity("DecoderStream", "DecoderStream"); // 1 comment
#if UNITY_ANDROID && !UNITY_EDITOR
debug_in_unity("DecoderStream", "UNITY_ANDROID"); // 2 comment
#elif UNITY_EDITOR
debug_in_unity("DecoderStream", "UNITY_EDITOR"); // 3 comment
m_p_tex_decoder = new DecoderTextureFFmpeg();
#else
debug_in_unity("DecoderStream", "else"); // 4 comment
#endif
}
If I compile this code and run it in Unity I see 1 comment
and 4 comment
I see that preprocessor conditions doesn't work, I mean it doesn't recognize that whether it android or unity editor...
What am I doing wrong?