I know that the C# preprocessor will generally eliminate the precompiled symbols. Can the rule be broken a bit?
For example, I have a C# dll A, which I wanna use in another C# program B. In B I have different precompiled symbols X, Y, Z. If X is defined, I need a version of A. Else if Y is defined, I need another version of A. And similar for Z. To implement this, I want to write precompiled directives in A's source code, like
public static class MyClass
{
public static void MyMethod()
{
#if X
DoX();
#elif Y
DoY();
#elif Z
DoZ();
#else
DoWhatever();
#endif
}
}
I hope these conditions don't disappear during A's compiling and B can take use of them. Is it possible? Or what should I do to work around this?
Thanks in advance.
EDIT
Some background information. B is a Unity3D Game, and A is a common library we want to use across different games. So Both A and B relies on the assembly UnityEngine.dll. Then there is various precompiled symbols defined by U3D to indicate the current build platform, the engine's version and etc, which I want to take use of in both A and B.