Hello,
I am building a Windows Store application using the below script. I am getting error Error 5 The type or namespace name ‘WSA’ does not exist in the namespace ‘UnityEngine’ (are you missing an assembly reference?) I am still learning Unity and C#, but I once had the same issue in another app but some how I got it working. How do I get the WSA added into the UnityEngine?
Thanks,
John
code:
using UnityEngine;
#if UNITY_WINRT
using System;
using System.Collections;
using System.Threading;
using System.IO;
/// <summary>
/// Windows specific and interop between Unity and Windows Store or Windows Phone 8
/// </summary>
public static class WindowsGateway
{
//notes
static WindowsGateway()
{
#if UNITY_METRO
// unity now supports handling size changed in 4.3
//UnityEngine.WSA.Application.windowSizeChanged += WindowSizeChanged;
UnityEngine.WSA.Application.windowSizeChanged += WindowSizeChanged;
#endif
// create blank implementations to avoid errors within editor
UnityLoaded = delegate { };
//blank implementation for our Share function
ShareHighScore = delegate { };
}
/// <summary>
/// Called from Unity when the app is responsive and ready for play
/// </summary>
public static Action UnityLoaded;
//called when we want to Share a high score
public static Action ShareHighScore;
#if UNITY_METRO
/// <summary>
/// Deal with windows resizing
/// </summary>
public static void WindowSizeChanged(int width, int height)
{
if (width <= GameManager.Instance.startingScreenSize.Width / 2)
{
//GameManager.Instance.paused();
Pause.paused = true;
}
else
{
//GameManager.Instance.unpaused();
Pause.paused = false;
}
}
#endif
}
#endif