handzlikchris / handzlikchris/FastScriptReload
Inheriting from 'Editor' in runtime script is causing error CS0118: 'Editor' is a namespace but is used like a type
- 主要言語
- C#
- スター
- 2.2k
- フォーク
- 167
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
This is down to Editor assembly not being referenced for new hot reloaded assembly
FSR: Error when updating files: 'AddNewFieldsTest.cs', FastScriptReload.Editor.Compilation.HotReloadCompilationException: Compiler failed to produce the assembly. Output: 'C:\Users\Chris\AppData\Local\Temp\72848fbb3b4645e28394c26e99b3c675.SourceCodeCombined.cs(124,52): error CS0118: 'Editor' is a namespace but is used like a type
C:\Users\Chris\AppData\Local\Temp\72848fbb3b4645e28394c26e99b3c675.SourceCodeCombined.cs(126,30): error CS0115: 'AddNewFieldsTestEditor__Patched_.OnInspectorGUI()': no suitable method found to override' ---> System.Exception: Compiler failed to produce the assembly. Output: 'C:\Users\Chris\AppData\Local\Temp\72848fbb3b4645e28394c26e99b3c675.SourceCodeCombined.cs(124,52): error CS0118: 'Editor' is a namespace but is used like a type
C:\Users\Chris\AppData\Local\Temp\72848fbb3b4645e28394c26e99b3c675.SourceCodeCombined.cs(126,30): error CS0115: 'AddNewFieldsTestEditor__Patched_.OnInspectorGUI()': no suitable method found to override'
at FastScriptReload.Editor.Compilation.DotnetExeDynamicCompilation.ExecuteDotnetExeCompilation (System.String dotnetExePath, System.String cscDll, System.String rspFile, System.String outLibraryPath, System.Collections.Generic.List`1[System.String]& outputMessages) [0x001fe] in E:\_src-unity\FastScriptReload\Assets\FastScriptReload\Scripts\Editor\Compilation\DotnetExeCompilator.cs:309
at FastScriptReload.Editor.Compilation.DotnetExeDynamicCompilation.Compile (System.Collections.Generic.List`1[T] filePathsWithSourceCode, ImmersiveVRTools.Runtime.Common.UnityMainThreadDispatcher unityMainThreadDispatcher) [0x00145] in E:\_src-unity\FastScriptReload\Assets\FastScriptReload\Scripts\Editor\Compilation\DotnetExeCompilator.cs:107
--- End of inner exception stack trace ---
at FastScriptReload.Editor.Compilation.DotnetExeDynamicCompilation.Compile (System.Collections.Generic.List`1[T] filePathsWithSourceCode, ImmersiveVRTools.Runtime.Common.UnityMainThreadDispatcher unityMainThreadDispatcher) [0x001e7] in E:\_src-unity\FastScriptReload\Assets\FastScriptReload\Scripts\Editor\Compilation\DotnetExeCompilator.cs:150
at FastScriptReload.Editor.Compilation.DynamicAssemblyCompiler.Compile (System.Collections.Generic.List`1[T] filePathsWithSourceCode, ImmersiveVRTools.Runtime.Common.UnityMainThreadDispatcher unityMainThreadDispatcher) [0x0000e] in E:\_src-unity\FastScriptReload\Assets\FastScriptReload\Scripts\Editor\Compilation\DynamicAssemblyCompiler.cs:23
at FastScriptReload.Editor.FastScriptReloadManager+<>c__DisplayClass54_1.b__1 () [0x00063] in E:\_src-unity\FastScriptReload\Assets\FastScriptReload\Scripts\Editor\FastScriptReloadManager.cs:380
UnityEngine.Logger:Log (UnityEngine.LogType,object)
ImmersiveVrToolsCommon.Runtime.Logging.LoggerScoped:LogInternal (UnityEngine.LogType,object) (at Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/Runtime/Logging/LoggerScoped.cs:52)
ImmersiveVrToolsCommon.Runtime.Logging.LoggerScoped:LogError (object) (at Assets/FastScriptReload/Plugins/ImmersiveVrToolsCommon/Runtime/Logging/LoggerScoped.cs:57)
FastScriptReload.Editor.FastScriptReloadManager/<>c__DisplayClass54_1:b__1 () (at Assets/FastScriptReload/Scripts/Editor/FastScriptReloadManager.cs:425)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs の、309 行目で報告されているコンパイルフロー付近から開始し、続いて DynamicAssemblyCompiler.cs と FastScriptReloadManager.cs を追跡します。AddNewFieldsTest.cs のホットリロード失敗を再現し、新しいアセンブリが Unity の Editor アセンブリをどのように参照しているかを特定します。継承された Editor スクリプトが CS0118 および CS0115 エラーなしでコンパイルおよびリロードされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp, unity
- 領域
- devtools, game-dev
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100