unity-cognitive-services-demos
unity-cognitive-services-demos copied to clipboard
`File' does not exist in the namespace `UnityEngine.Windows'
When imported, two errors:
Assets/Scripts/ImageToEmotionAPI.cs(39,44): error CS0234: The type or namespace name File' does not exist in the namespace
UnityEngine.Windows'. Are you missing an assembly reference?
Assets/Scripts/ShowImageOnPanel.cs(28,27): error CS0103: The name `File' does not exist in the current context
How to solve them?
Ok, it seems that this can work: In ShowImageOnPanel.cs: #if UNITY_WINRT byte[] fileData = UnityEngine.Windows.File.ReadAllBytes(fileName); #else byte[] fileData = System.IO.File.ReadAllBytes(fileName); #endif
Instead, in ImageToEmotionAPI.cs: #if UNITY_WINRT byte[] bytes = UnityEngine.Windows.File.ReadAllBytes(fileName); #else byte[] bytes = System.IO.File.ReadAllBytes(fileName); #endif
how does this work??