How do we call functions when those functions are wrapped in #IF_ENABLE_WINMD_SUPPORT tags? Those functions don’t technically exist in Unity when we do this so it leads to build errors and all sorts of other issues.
I’m developing UWP for id@xbox and am getting absolutely nowhere. I’ve got the correct winmd and dll files installed. The Intellisense lights up correctly in VS.
I’ve been trying to port our existing Windows game to UWP now for over 4 months at 12-20 hours every day, and I’m slowly going insane.
Is there something I’m missing here?
First of all, the tag is “#if ENABLE_WINMD_SUPPORT”, not “#IF_ENABLE_WINMD_SUPPORT”. Secondly, if it lights up in intellisense in Visual Studio, it should not produce build errors when exporting UWP player.
Can you show some screenshots of Visual Studio recognizing the APIs and the Unity log from when it fails the build?
Sorry, ignore the type error.
I’ve solved the issue with the failed builds BUT my question about calling functions hidden within #if ENABLE_WINMD_SUPPORT still stands because how do we call one of those functions from something like the On Click() part of a UI button, for example, when the function doesn’t show in the list because it’s within an #if ENABLE_WINMD_SUPPORT?
Instead of wrapping the whole function, wrap only its body in the #if check. For instance instead of:
#if ENABLE_WINMD_SUPPORT
void DoSomething()
{
....
}
#endif
Do this:
void DoSomething()
{
#if ENABLE_WINMD_SUPPORT
....
#endif
}