fix: #2579 "No writer found" error when running Mirror tests in Unity 2020.3 Editor. fixes the first bug in editor, but maybe not the runtime bug? or maybe it does.

This commit is contained in:
vis2k 2021-03-26 11:17:56 +08:00
parent b7c63c3067
commit 417642475a

View File

@ -127,8 +127,10 @@ static bool LoadDeclaredReaders(AssemblyDefinition currentAssembly, TypeDefiniti
static bool IsEditorAssembly(AssemblyDefinition currentAssembly)
{
// we want to add the [InitializeOnLoad] attribute if it's available
// -> usually either 'UnityEditor' or 'UnityEditor.CoreModule'
return currentAssembly.MainModule.AssemblyReferences.Any(assemblyReference =>
assemblyReference.Name == nameof(UnityEditor)
assemblyReference.Name.StartsWith(nameof(UnityEditor))
);
}