The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Loading and saving difficulties currently with Unity5.50b7 and Hololens
I want to save and load persistently using the Hololens. I am confused by the fact that
1) The maximum version of C# that is compatible with the Unity platform is C# 4.4
2) Universal Windows Platform allows the frequent use of new asynchronous symbols in its arsenal such as async, await, task
. These are not available until you use C#5 and C#6. However I have seen references to other users using C#5 commands with the hololens such as
https://forums.hololens.com/discussion/1662/loading-a-file-from-onedrive-on-hololens
You look at the project in Unity 5.50b7 and you get error messages. How can this be?
3) The binaryformatter does not seem to be available in UWP as the namespace is missing. You can use the sharpSerializer free add in and you can download the dll
Polenter.SharpSerializer.Portable.dll
and plonk it into your Asset directory. Unity will then nicely include it as a reference in your next build from Unity and you can then see it in VS15 in your object browser.
4) Windows.Storage namespace is not available if you want to use Unity again. There is no problem until you have to go back to Unity, then you find it is gives file errors on its version of C# 4.4.
I find it extraordinary that I have to go to such lengths to get support for loading and saving files from my HoloLens App. Surely I have made an error here. Can anyone advise me on what I have done incorrectly?
Best Answers
-
Yes I was using the 5.50b7 version and got confused about which was correct and whether my development would be for nothing. I am re-configuring my app to work with what Microsoft recommend now. I'll tell you later if this means I can work with async, await and task - the common ingredients to UWP focused procedures. This might be a complete red herring but I must try it. I'll post up any results I find. Thank you for your help.
6 -
Jimbohalo10 and SpheredCazual thank you for your help. It did indeed get me to a conclusion. I found that version 5.4f3-HTP seemed to allow the async, await, task group that the other implementation 5.5 betas did not. Obviously the HTP code has been customized to allow C#5 commands of this type as Unity suggests being based on C#4.4 at best. Therefore in my rather dubious judgement, I would definitely choose the HTP type updates proposed by MicroSoft in preference to Unity's.
I have included routines that I commented out earlier compiled, linked and run to prove that it works. Full Example not shown here but here is some snippet of how to read a text file:-
static async public void read_storage(string name) { try { var item = await storageFolder.TryGetItemAsync(name); readfile = (item != null) ? (StorageFile)item : null; } catch (Exception e) { } if (readfile != null) { dataset = await FileIO.ReadLinesAsync(readfile); } }
6
Answers
First things first the latest version of unity with Hololens support is 5.4.0f3-HTP (https://unity3d.com/partners/microsoft/hololens#download). Secondly can you give some sample code you have written so we can assist you.
Secondly: try looking at this tutorial https://unity3d.com/learn/tutorials/topics/scripting/persistence-saving-and-loading-data
creative mind, free thinker, dreamer, maker, mostly working on games and doodling around with gadgets, Sphered Cazual/Elite/Master of the Universe/Dad/Husband @mariovermeulen
Dear SpheredCazual,
Are all Hololens compatible updates to Unity shown in the Version number as having an -HTP suffix? I notice in previous queries in August that JimboHalo10 comments
_> Jimbohalo10 ✭✭✭ August 5 edited August 5
This is in Q & A
https://forums.hololens.com/discussion/65/hololens-unity-5-4-0b7
So the developer @TRR was using the non-holoLens version of the installation you were suggesting to me as it was (5.4.0f3) instead of the version holoLens compatible version 5.4.0f3-HTP ?
It does seem odd as on the microsoft forum here it still says use the older beta versaion but on Unity forum it says it is also included in the latest beta versions https://forum.unity3d.com/threads/new-build-hololens-now-included-in-the-5-5-betas.418134/
So it would be a choice to go witht the one noted here or with the latest BETA from Unity, not sure what is wise ;-)
FYI I ave stayed with using the HTP version
creative mind, free thinker, dreamer, maker, mostly working on games and doodling around with gadgets, Sphered Cazual/Elite/Master of the Universe/Dad/Husband @mariovermeulen
Yes I was using the 5.50b7 version and got confused about which was correct and whether my development would be for nothing. I am re-configuring my app to work with what Microsoft recommend now. I'll tell you later if this means I can work with async, await and task - the common ingredients to UWP focused procedures. This might be a complete red herring but I must try it. I'll post up any results I find. Thank you for your help.
Hi from the Unity 5.5B7 Release Notes is these known problems
Windows Store: Building to a folder outside of the project folder fails. (826034)
Windows Store: Editor crashes when canceling build when build progress shows "Restoring NuGet packages". (826083)
HoloLens: The builtin spatial mapping occlusion shader has been optimized, thus provides higher frame rates.
Except that the Shader compiler has internal errors , when trying to build with WSA Player Universal 10,D3D, C# output. _
Crashes after Restoring NuGet Packages, especially .Net Core 5.0, know as the UWP libraries.
This has intermittent problems, the Windows 10 needs a restart, probably needs creating of several folders, before building, then has debug errors whilst in Visual Studio 2015 update 3.
Works first time in 5.4F3 HTP (HoloLens Technical Preview)
Unity Support are not interested in fixing WSA Player errors at the moment. My project is large and takes over 60 seconds to load into VS2015, over 200 files from a large Unity Asset store app.
Jimbohalo10 and SpheredCazual thank you for your help. It did indeed get me to a conclusion. I found that version 5.4f3-HTP seemed to allow the async, await, task group that the other implementation 5.5 betas did not. Obviously the HTP code has been customized to allow C#5 commands of this type as Unity suggests being based on C#4.4 at best. Therefore in my rather dubious judgement, I would definitely choose the HTP type updates proposed by MicroSoft in preference to Unity's.
I have included routines that I commented out earlier compiled, linked and run to prove that it works. Full Example not shown here but here is some snippet of how to read a text file:-