mirror of
				https://github.com/DerTyp7/defrain-shooter-unity.git
				synced 2025-10-31 05:27:07 +01:00 
			
		
		
		
	CHANGED TO MIRROR
This commit is contained in:
		
							
								
								
									
										26
									
								
								Assets/Mirror/Editor/Weaver/Helpers.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								Assets/Mirror/Editor/Weaver/Helpers.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | ||||
| using System.IO; | ||||
| using System.Linq; | ||||
| using System.Reflection; | ||||
| using Mono.CecilX; | ||||
|  | ||||
| namespace Mirror.Weaver | ||||
| { | ||||
|     static class Helpers | ||||
|     { | ||||
|         // This code is taken from SerializationWeaver | ||||
|         public static string UnityEngineDllDirectoryName() | ||||
|         { | ||||
|             string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase); | ||||
|             return directoryName?.Replace(@"file:\", ""); | ||||
|         } | ||||
|  | ||||
|         public 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.StartsWith(nameof(UnityEditor)) | ||||
|             ); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 DerTyp187
					DerTyp187