handzlikchris / handzlikchris/FastScriptReload

Inheriting from 'Editor' in runtime script is causing error CS0118: 'Editor' is a namespace but is used like a type

Ouverte
#21 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
C#
Étoiles
2.2k
Forks
167
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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 ()

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez dans Assets/FastScriptReload/Scripts/Editor/Compilation/DotnetExeCompilator.cs, autour du flux de compilation signalé à la ligne 309, puis suivez DynamicAssemblyCompiler.cs et FastScriptReloadManager.cs. Reproduisez l’échec du hot-reload de AddNewFieldsTest.cs et déterminez comment le nouvel assembly référence l’assembly Editor de Unity ; le travail est terminé lorsque le script Editor hérité se compile et se recharge sans les erreurs CS0118 et CS0115.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
csharp, unity
Domaine
devtools, game-dev
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.