簡體   English   中英

Unity Hololens(UWP)構建會產生獨立構建不會出現的錯誤嗎?

[英]Unity Hololens (UWP) build generates errors that Standalone builds do not?

替代標題:Hololens Windows UWP Builds的Unity References Bug(10.0.10586.0)? 或者...... Unity Hololens Builds可以訪問Standalone Build DLL引用嗎?

快速預文:我正在設計一個在Hololens上運行的應用程序。 這款游戲在Unity內部播放完美。 它可以毫無錯誤地構建到PC,Mac和Linux獨立平台上。

但是,構建到Windows應用商店平台時會出現“缺少”引用的錯誤。 (缺少是引號,因為我已經徹底檢查並重新檢查我正在使用正確的引用,並且它們位於它們應該位於的位置)。

嘗試構建時的初始錯誤是:

Error building Player because scripts had compiler errors
error: The type or namespace name 'FileSystemEventArgs' could not be found (are you missing a using directive or an assembly reference?)
private void PrototypeFileWatcher_Created(object sender, FileSystemEventArgs e)
{
    ...
}

通過注釋掉上述函數和相關代碼來糾正此錯誤,並再次嘗試構建時,會出現以下錯誤:

error: The name 'Console' does not exist in the current context
catch (Exception e)
{
    Console.WriteLine(e.Message);
}

error: Argument 1: cannot convert from 'string' to 'System.IO.Stream'
using (StreamReader sr = new StreamReader(path))
{
    ...
}

error: The type or namespace name 'BufferedStream' could not be found (are you missing a using directive or an assembly reference?)
using (BufferedStream bs0 = new BufferedStream(f0))
{
    ...
}

參考文獻存儲在適當的位置:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Unity Full v3.5\System.Core.dll

引用列在腳本的標題中:

using UnityEngine;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Threading;

盡管如此。 我試過了:

-Changing Api Compatibility Level*
-Changing the project solutions net framework
-#if NETFX_CORE using x = WinRTLegacy.x; #else
-#if WINDOWS_UWP using System; #endif
-Trashing the project entirely and rebuilding from scratch
-And lots more

現在為這個問題苦苦掙扎了整整一天。 我有NuGet pkgs,用於Unity的VS工具(也稱為VSTU),我正在使用VS2015。 我現在完全失去了。 我不明白我是否無法將其構建到Windows Store平台,因為它無法使用Unity獨立版本可以使用的某些DLL?

HoloLens應用程序僅限於使用UWP應用程序中的可用內容。 有些東西在Unity編輯器中可以在HoloLens應用程序中工作,因為統一編輯器使用單聲道而不是.net構建。 你應該將自己限制在UWP中工作的東西,它們也可以在編輯器中正常工作。 即使是全套的UWP API也無法在HoloLens上使用。

UWP的完整文檔如下:

https://docs.microsoft.com/en-us/uwp/api/

專門為HoloLens添加的子集位於此頁面的底部:

https://developer.microsoft.com/en-us/windows/mixed-reality/development

不幸的是,沒有一個地方突出了不可用的東西。 Visual Studio編譯器將幫助您了解存在的內容和不存在的內容。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM