質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.47%
Oculus

Oculusは、 仮想現実のハードウェアなどを開発している米IT企業、およびそのVRデバイスのシリーズ。低価格で広い視野角やヘッドトラッキングが特徴のVRヘッドセット「Oculus Rift」を始め、さまざまなVRデバイスがリリースされています。

C#

C#はマルチパラダイムプログラミング言語の1つで、命令形・宣言型・関数型・ジェネリック型・コンポーネント指向・オブジェクティブ指向のプログラミング開発すべてに対応しています。

ビルド

ソースコードを単体で実行可能なソフトウェアへ変換する過程をビルド(build)と呼びます

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Q&A

解決済

1回答

2800閲覧

unityのコンパイルエラーを修正方法を教えてください.oculus ビルドのため

moneno

総合スコア0

Oculus

Oculusは、 仮想現実のハードウェアなどを開発している米IT企業、およびそのVRデバイスのシリーズ。低価格で広い視野角やヘッドトラッキングが特徴のVRヘッドセット「Oculus Rift」を始め、さまざまなVRデバイスがリリースされています。

C#

C#はマルチパラダイムプログラミング言語の1つで、命令形・宣言型・関数型・ジェネリック型・コンポーネント指向・オブジェクティブ指向のプログラミング開発すべてに対応しています。

ビルド

ソースコードを単体で実行可能なソフトウェアへ変換する過程をビルド(build)と呼びます

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

0グッド

0クリップ

投稿2020/11/23 22:31

Unity でOculus go のビルドをしたいがコンパイルエラー

unityでoculus go , questのアプリを作っていますが、コンパルエラーが出てしまいます。(今はgoのみで練習をしています。)

発生している問題・エラーメッセージ

Assets/Plugins/RenderHeads/HierarchyRestore/Scripts/HierarchyNode.cs(53,8): error CS0103: The name 'HierarchyUtils' does not exist in the current context

Build completed with a result of 'Failed' in 4 seconds (3990 ms)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:136)

UnityEditor.BuildPlayerWindow+BuildMethodException: Error building Player because scripts have compile errors in the editor
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002af] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:194
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:95
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:136)

エラーメッセージ

該当のソースコード

c#

ソースコード `#if UNITY_5_3 || UNITY_5_4_OR_NEWER #define RH_UNITY_FEATURE_SCENEMANAGMENT #endif #if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0) #define RH_UNITY_FEATURE_DEBUG_ASSERT #endif using UnityEngine; // Note: This script is only for the editor, but we don't put it into an Editor folder because it needs to be attached to a Monobehaviour #if UNITY_EDITOR using UnityEditor; #if RH_UNITY_FEATURE_SCENEMANAGMENT using UnityEditor.SceneManagement; #endif //----------------------------------------------------------------------------- // Copyright 2017-2019 RenderHeads Ltd. All rights reserverd. //----------------------------------------------------------------------------- namespace RenderHeads.Framework.Editor { /// <summary> /// This component is mainly used to detect when a scene is unloaded as it uses the OnDestroy() hook to save the current hierarchy state /// </summary> [ExecuteInEditMode] public class HierarchyNode : MonoBehaviour { private string _sceneGUID; private string _selectionPathList; private string _hierarchyPathList; private int editorUpdateCount; private bool _isHierarchyDirty; private static Transform[] _lastSelection; private void Start() { RestoreSelection(); } private void OnEnable() { EditorApplication.update += OnEditorUpdate; } private void OnDisable() { EditorApplication.update -= OnEditorUpdate; } // When the scene closes, this node will get destroyed, at which point we save the scene state information private void OnDestroy() { if (HierarchyUtils.IsHierarchyWindowInPrefabMode()) { return; } SaveHierarchyState(_hierarchyPathList, _sceneGUID); SaveSelectionState(_selectionPathList, _sceneGUID); } private void RestoreSelection() { if (HierarchyUtils.IsHierarchyWindowInPrefabMode()) { return; } UpdateSceneGUID(); if (!string.IsNullOrEmpty(_sceneGUID)) { _hierarchyPathList = RestoreHierarchyState(_sceneGUID, true); _selectionPathList = RestoreSelectionState(_sceneGUID, true); //Debug.Log("hierarchy " + _hierarchyPathList); //Debug.Log("selection " + _selectionPathList); if (string.IsNullOrEmpty(_selectionPathList)) { // No selection was restored, so we need to select at least one node so that the hierarchy expansion happens. // So just select one of the items in the hierarchyList string[] paths = null; { // Convert the string list to an array if (!string.IsNullOrEmpty(_hierarchyPathList)) { paths = _hierarchyPathList.Split(new char[] { '*' }, System.StringSplitOptions.RemoveEmptyEntries); } // Select the first found expanded object if (paths != null && paths.Length > 0) { foreach (string path in paths) { GameObject go = GameObject.Find(path); if (go != null) { Selection.activeGameObject = go; break; } } } } } // Only force the hierarchy window to update if something has changed if (Selection.activeGameObject != null || !string.IsNullOrEmpty(_hierarchyPathList)) { // Force the hierarchy window to update to the current selection EditorApplication.DirtyHierarchyWindowSorting(); // NOTE: We need to use the delayCall because sometimes DirtyHierarchyWindowSorting() doesn't work the first time EditorApplication.delayCall += () => { // Force the hierarchy window to update to the current selection EditorApplication.DirtyHierarchyWindowSorting(); }; } } } private void OnEditorUpdate() { // Editor updates are expensive, so don't do them too often as it can slow down the UI if (editorUpdateCount > 50 && // We don't want to save hierarchy/selection when the app is playing !EditorApplication.isPlaying && !EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isCompiling && !EditorApplication.isUpdating && !HierarchyUtils.IsHierarchyWindowInPrefabMode()) { editorUpdateCount = 0; if (HasSelectionChanged() || HasHierarchyChanged()) { CacheHierarchy(); } } editorUpdateCount++; } public void SetHierarchyDirty() { _isHierarchyDirty = true; } private bool HasHierarchyChanged() { return _isHierarchyDirty; } private static bool HasSelectionChanged() { bool result = false; // Ignore null selections if (Selection.activeGameObject != null) { if (_lastSelection == null) { result = true; } else { if (Selection.transforms.Length != _lastSelection.Length) { result = true; } else { #if RH_UNITY_FEATURE_DEBUG_ASSERT Debug.Assert(Selection.transforms.Length == _lastSelection.Length); #endif for (int i = 0; i < _lastSelection.Length; i++) { if (_lastSelection[i] != Selection.transforms[i]) { result = true; break; } } } } if (result) { _lastSelection = Selection.transforms; } } return result; } private void CacheHierarchy() { UpdateSceneGUID(); if (Selection.activeGameObject != null) { _selectionPathList = HierarchyUtils.GetSelectionAsString(); } _hierarchyPathList = HierarchyUtils.GetHierarchyAsString(); _isHierarchyDirty = false; } private void UpdateSceneGUID() { #if RH_UNITY_FEATURE_SCENEMANAGMENT _sceneGUID = GetSceneGUID(EditorSceneManager.GetActiveScene().path); #else _sceneGUID = GetSceneGUID(EditorApplication.currentScene); #endif } public static string GetSceneGUID(string path) { return GetFullPath(path); } private static string GetFullPath(string relativePath) { string result = relativePath; if (!string.IsNullOrEmpty(result)) { result = System.IO.Path.GetFullPath(result); result = result.Replace('\', '/'); } return result; } public static string RestoreSelectionState(string sceneId, bool logMissingNodes) { string result = EditorPrefs.GetString(GetEditorPref("Selection", sceneId), string.Empty); if (!HierarchyUtils.SetSelectionFromString(result, logMissingNodes)) { result = string.Empty; } return result; } public static string RestoreHierarchyState(string sceneId, bool logMissingNodes) { // If it returns notset then this scene hasn't had any hierarchy state saved before // If it returns null/empty, then all hierarchy is collapsed string notset = "notset"; string result = EditorPrefs.GetString(GetEditorPref("Hierarchy", sceneId), notset); if (result != notset) { HierarchyUtils.SetHierarchyFromString(result, logMissingNodes); } else { result = string.Empty; } return result; } public static void SaveSelectionState(string state, string sceneId) { // No point in saving empty selection if (!string.IsNullOrEmpty(state)) { SaveState("Selection", state, sceneId); } } public static void SaveHierarchyState(string state, string sceneId) { SaveState("Hierarchy", state, sceneId); } private static void SaveState(string stateName, string state, string sceneId) { //Debug.Log("SAVING: " + state + " " + GetEditorPref(stateName, sceneId)); EditorPrefs.SetString(GetEditorPref(stateName, sceneId), state); } private static string GetEditorPref(string name, string sceneId) { return string.Format("RenderHeads-HierarchyRestore-{0}-{1}", name, sceneId); } } } #endif ### 試したこと エラーやコンパイルエラーに関する記事を探しましたが、ヒエラルキーの箇所をどのように修正すればいいのかわかりません。よろしくお願いいたします。 ここに問題に対して試したことを記載してください。 ### 補足情報(FW/ツールのバージョンなど) ここにより詳細な情報を記載してください。 unity 2019 oculus go

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

エラー修正の方法を探すことができなかったため、もう一度unityのプロジェクトを作り直してみました。インポートするアセットによってエラーができるのですが、ひとまず一つのエラーを解決することができましたので、もう一度最初からやり直し、出直します。ありがとうございました。

投稿2020/11/24 13:49

moneno

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.47%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問