- Home /
How do I test winmd_support code inside Unity editor
I have some code that works through a bridge created by another developer in the team. I need to test this if this code works. But his code is inside a #if UNITY_WSA && ENABLE_WINMD_SUPPORT block because his code only works in UWP. Is there a way to test this inside the editor? Instead of taking away 20 minutes to build a visual studio solution and make a side loading app from that every time. The code only works in UWP, I'm guessing that's why there the IF block
I already tried removing the ENABLE_WINMD_SUPPORT part since UNITY_WSA can be tested in the editor by switching platforms. However, his code doesn't work then.
private static IOpenPrint CreatePrint()
{
#if UNITY_WSA && ENABLE_WINMD_SUPPORT
return new Print();
#endif
I would like to test this code he made with a bridge inside the editor. However, it seems that it only works inside the ENABLE WINMD_SUPPORT block and I have no further knowledge about his code etc.
EDIT: I also tried this settings documented on the Unity documentation. But they appear to be correct. https://docs.unity3d.com/Manual/IL2CPP-WindowsRuntimeSupport.html
EDIT2: I found some code that appears to link the bridge, this code is also in the same if block with #if UNITY_WSA && ENABLE_WINMD_SUPPORT. Removing the#ENABLE_WINMD_SUPPORT doesn't seem to work as then I get an error on the IL2CPPToDotNetBridge name.
public class Print : IOpenPrint {
public void OpenPrintDialogAsync(Texture2D image, Action<bool> result)
{
image.ReadPixels(new Rect(0, 0, image.width, image.height), 0, 0);
byte[] bytes;
bytes = image.GetRawTextureData();
var bridge = IL2CPPToDotNetBridge.BridgeBootstrapper.GetDotNetBridge();
if (bridge != null && bytes != null)
bridge.OnPrint(bytes, image.width, image.height, (IL2CPPToDotNetBridge.OnPrintFinish)Delegate.CreateDelegate(typeof(IL2CPPToDotNetBridge.OnFinish), result.Target, result.Method));
} }
NOTE: I changed some names.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Renderer on object disabled after level reload 1 Answer