-1

As soon as I import the GoogleVR for Unity asset into the newest version of Unity, I get the following compile errors:

Assets/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorClientSocket.cs(74,46): error CS0120: An object reference is required to access non-static member `System.Diagnostics.Process.Start()'

Assets/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorClientSocket.cs(79,17): error CS1061: Type `System.Diagnostics.Process' does not contain a definition for `Close' and no extension method `Close' of type `System.Diagnostics.Process' could be found (are you missing a using directive or an assembly reference?)

This is happening on a totally empty project with the most recent versions of GoogleVR and Unity for OSX. Has anyone else seen this?

bumpkin
  • 3,321
  • 4
  • 25
  • 32
  • Looks like this is the version of the code? https://github.com/googlevr/gvr-unity-sdk/blob/master/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorClientSocket.cs#L74 – Ben Voigt Jun 06 '16 at 18:43
  • It looks like your .NET environment is broken, according to the official documentation those calls exist since .NET 1.1. Are you building for some restricted profile? * https://msdn.microsoft.com/en-us/library/system.diagnostics.process.close.aspx – Ben Voigt Jun 06 '16 at 18:46
  • @BenVoigt Unity does use a restricted profile, you may be right. EDIT: But that package is specifically for unity, so that should not be a problem to use it. – Scott Chamberlain Jun 06 '16 at 19:42
  • @BenVoigt Not sure if helpful, I'm on a Mac. – bumpkin Jun 06 '16 at 21:24
  • @bumpkin: You're using .NET so you must have Mono.... I'm not sure whether Unity updates Mono for you or you need to update it separately. – Ben Voigt Jun 06 '16 at 21:52
  • @BenVoigt Tried downloading and installing new Mono, didn't work :-/ – bumpkin Jun 06 '16 at 22:01
  • What platform are your build settings set to? And manually updating Mono is not going to help you.You'll have to use what Unity bundles with, which for now is a fairly outdated version. – Bart Jun 07 '16 at 08:40

2 Answers2

0

Updated Unity to 5.4.0B20 (the most recent Beta version) and it just worked. Found that solution on the Unity forums, but now can't find where.

bumpkin
  • 3,321
  • 4
  • 25
  • 32
0

This is due to the fact that in some version of Unity, the default platform is WebGL. You can solve this by switching to the Android platform in File | Build Settings.

You can switch the platform by File -> Build Setting -> select Android and click Switch Platform

Yeven
  • 1
  • 2