SteamVR

SteamVR

Unity Plugin 1.2.3 Not compiling for UWP
OK, with 1.2.2 I saw it was able to build for UWP (awesome because mantaining 2 projects was a pain) .
So I imported 1.2.3 (because that was what already was on store) got iti working on editor and standalone so when making a build for UWP 8.1 (on U4.7.2) I get the console flooded with exceptions.

For example;
Assets\SteamVR\Scripts\SteamVR_ExternalCamera.cs(39,26): error CS0234: El tipo o el nombre del espacio de nombres 'File' no existe en el espacio de nombres 'System.IO' (�falta una referencia de ensamblado?)

so... lets check code..

#if !UNITY_METRO
// Listen for changes.
if (watcher == null)
{
var fi = new System.IO.FileInfo(configPath);
watcher = new System.IO.FileSystemWatcher(fi.DirectoryName, fi.Name);
watcher.NotifyFilter = System.IO.NotifyFilters.LastWrite;
watcher.Changed += new System.IO.FileSystemEventHandler(OnChanged);
watcher.EnableRaisingEvents = true;
}
}

void OnChanged(object source, System.IO.FileSystemEventArgs e)
{
ReadConfig();
}

System.IO.FileSystemWatcher watcher;
#else

So according to U4.7.2 manual :
UNITY_METRO
Platform define for Windows Store Apps (additionally NETFX_CORE is defined when compiling C# files against .NET Core).

So I believe you'll whant to wrap the thing with NETF_CORE define instead or is any reason not to just do with it do with
#if !(UNITY_METRO || NETFX_CORE)

but, further, there is stuff that is not yet compatible in this same script.
line 39:
var lines = System.IO.File.ReadAllLines(configPath);

"File" does not exist in UWP
For this kind of stuff I use Unified IO but I remember there was stuff like readallbytes available in UWP.

BUT, as I believe this is just to ENABLE compiling and not to make Steam VR run under UWP, just ignoring that line when building should do the job.
< >
Viser 1-1 af 1 kommentarer
There are parts of the code using reflection witch is not available in UWP

var fields = GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);

, may be is available in the very latest UWP version?. There is a very extense use of System.File too. I recon I've not build with a modern Unity version but theese are the tipyal things that breack compiling for UWP so I wonder why theese where left as is
Sidst redigeret af Tokyo Warfare Project; 22. maj 2018 kl. 15:01
< >
Viser 1-1 af 1 kommentarer
Per side: 1530 50

Dato opslået: 21. maj 2018 kl. 16:16
Indlæg: 1