我目前正在使用统一的Unity 2017.3.0f3(64位)和SteamVR Unity插件-v2.0。
我正在尝试为HTC Vive构建我的第一个VR项目。问题在于,当我尝试构建它时,它会删除我的action.json文件,然后给我一个FileNotFoundException错误,提示该action.json不存在。
我创建action.json的方式是:窗口> SteamVr输入> 在创建示例action.jon文件时单击是>打开绑定UI>替换默认值(适用于我的HTC vive控制器) )>保存并生成。
之后,成功构建了actions.json文件和几个其他json文件,并将其放置在项目的根目录中。但是,一旦我尝试构建项目,就立即删除actions.json文件,并收到以下大量错误消息:
[SteamVR]动作文件在项目根目录中不存在:C:/ Users / Me / Desktop / Unity Development / My Game \ actions.json UnityEngine.Debug:LogErrorFormat(String,Object []) Valve.VR.SteamVR_Input:InitializeFile(布尔值)(位于Assets / SteamVR / Input / SteamVR_Input.cs:705) Valve.VR.SteamVR_Input_EditorWindow:Initialize()(位于Assets / SteamVR / Input / Editor / SteamVR_Input_EditorWindow.cs:256) Valve.VR.SteamVR_Input_EditorWindow:CheckFileInitialized()(位于Assets / SteamVR / Input / Editor / SteamVR_Input_EditorWindow.cs:277) Valve.VR.SteamVR_Input_EditorWindow:OnGUI()(位于Assets / SteamVR / Input / Editor / SteamVR_Input_EditorWindow.cs:329) UnityEngine.GUIUtility:ProcessEvent(Int32,IntPtr)
[SteamVR输入]无法将文件:C:/ Users / Me / Desktop / Unity Development / My Game / Assets / SteamVR / Input / ExampleJSON \ bindings_holographic_controller.json复制到路径:C:/ Users / Me / Desktop / Unity开发/我的游戏/bindings_holographic_controller.json UnityEngine.Debug:LogError(Object) Valve.VR.SteamVR_CopyExampleInputFiles:CopyFiles(Boolean)(位于Assets / SteamVR / Input / Editor / SteamVR_CopyExampleInputFiles.cs:62) Valve.VR.SteamVR_Input_EditorWindow:CopyOrClose()(位于Assets / SteamVR / Input / Editor / SteamVR_Input_EditorWindow.cs:266) Valve.VR.SteamVR_Input_EditorWindow:CheckFileInitialized()(位于Assets / SteamVR / Input / Editor / SteamVR_Input_EditorWindow.cs:285) Valve.VR.SteamVR_Input_EditorWindow:OnGUI()(位于Assets / SteamVR / Input / Editor / SteamVR_Input_EditorWindow.cs:329) UnityEngine.GUIUtility:ProcessEvent(Int32,IntPtr)
NullReferenceException:对象引用未设置为对象的实例 UnityEngine.GUILayoutUtility.LayoutFromContainer(单w,单h)(在C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:182) UnityEngine.Experimental.UIElements.UIElementsUtility.EndContainerGUI()(在C:/buildslave/unity/build/Runtime/UIElements/Managed/UIElementsUtility.cs:164) UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI(UnityEngine.Event evt)(在C:/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:267) UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent(UnityEngine.Event e)(位于C:/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:330) UnityEngine.Experimental.UIElements.IMGUIContainer.DoRepaint(IStylePainter画家)(在C:/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:68) UnityEngine.Experimental.UIElements.Panel.PaintSubTree(UnityEngine.Event e,UnityEngine.Experimental.UIElements.VisualElement根,Matrix4x4偏移量,Rect currentGlobalClip)(位于C:/buildslave/unity/build/Runtime/UIElements/Managed/Panel.cs :532) UnityEngine.Experimental.UIElements.Panel.PaintSubTreeChildren(UnityEngine.Event e,UnityEngine.Experimental.UIElements.VisualElement根,Matrix4x4偏移量,Rect textureClip)(位于C:/buildslave/unity/build/Runtime/UIElements/Managed/Panel.cs :547) UnityEngine.Experimental.UIElements.Panel.PaintSubTree(UnityEngine.Event e,UnityEngine.Experimental.UIElements.VisualElement根,Matrix4x4偏移量,Rect currentGlobalClip)(位于C:/buildslave/unity/build/Runtime/UIElements/Managed/Panel.cs :536) UnityEngine.Experimental.UIElements.Panel.Repaint(UnityEngine.Event e)(在C:/buildslave/unity/build/Runtime/UIElements/Managed/Panel.cs:564) UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch(UnityEngine.Experimental.UIElements.BaseVisualElementPanel面板)(位于C:/buildslave/unity/build/Runtime/UIElements/Managed/UIElementsUtility.cs:236) UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent(Int32 instanceID,IntPtr nativeEventPtr)(在C:/buildslave/unity/build/Runtime/UIElements/Managed/UIElementsUtility.cs:78) UnityEngine.GUIUtility.ProcessEvent(Int32 instanceID,IntPtr nativeEventPtr)(在C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUIUtility.cs:175)
FileNotFoundException:C:/ Users / Me / Desktop / Unity Development / My Game \ actions.json不存在 System.IO.File.Copy(System.String sourceFileName,System.String destFileName,布尔覆盖)(位于/Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:107) System.IO.File.Copy(System.String sourceFileName,System.String destFileName)(位于/Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:86) Valve.VR.SteamVR_Input_PostProcessBuild.OnPostprocessBuild(BuildTarget目标,System.String pathToBuiltProject)(在Assets / SteamVR / Input / Editor / SteamVR_Input_PostProcessBuild.cs:40) System.Reflection.MonoMethod.Invoke(System.Object obj,BindingFlags invokeAttr,System.Reflection.Binder绑定程序,System.Object []参数,System.Globalization.CultureInfo文化)(在/ Users / builduser / buildslave / mono / build / mcs / class / corlib / System.Reflection / MonoMethod.cs:222) 作为TargetInvocationException重新抛出:调用的目标已抛出异常。 System.Reflection.MonoMethod.Invoke(System.Object obj,BindingFlags invokeAttr,System.Reflection.Binder绑定程序,System.Object []参数,System.Globalization.CultureInfo文化)(在/ Users / builduser / buildslave / mono / build / mcs / class / corlib / System.Reflection / MonoMethod.cs:232) System.Reflection.MethodBase.Invoke(System.Object obj,System.Object []参数)(位于/Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) UnityEditor.Build.BuildPipelineInterfaces + AttributeCallbackWrapper.OnPostprocessBuild(BuildTarget目标,System.String路径)(位于C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:86) UnityEditor.Build.BuildPipelineInterfaces.OnBuildPostProcess(BuildTarget平台,System.String路径,布尔严格)(在C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:324) UnityEngine.GUIUtility:ProcessEvent(Int32,IntPtr)
构建播放器错误:FileNotFoundException:C:/ Users / Me / Desktop / Unity Development / My Game \ actions.json不存在
不确定我是否提供了所有需要的信息,因此,如果我错过了任何事情,请告诉我,我们将乐意提供更多信息。 谢谢!
答案 0 :(得分:0)
就我而言,这是通过使构建目录不同于action.json来解决的。