Unity3d edit mode test cases hot to set platform

69 views Asked by At

I have following code

#if UNITY_IOS && !UNITY_EDITOR
    public static MyPlugin Current = new MyPluginIOS();
#elif UNITY_ANDROID && !UNITY_EDITOR
    public static MyPlugin Current = new MyPluginAndroid();
#else
    public static MyPlugin Current = new MyPluginEditor();
#endif

I am writing test case and want to select platform As UNITY_ANDROID how can I do this?

1

There are 1 answers

0
hijinxbassist On

You can use the following line to define the UNITY_ANDROID preprocessor directive.

#define UNITY_ADROID

From the Docs found Here

#define lets you define a symbol. By using the symbol as the expression passed to the #if directive, the expression evaluates to true.

If you need to remove/undefine that preprocessor directive, you can use

#undef UNITY_ANDROID