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:
		
							
								
								
									
										32
									
								
								Assets/Mirror/Editor/Weaver/SyncVarAccessLists.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								Assets/Mirror/Editor/Weaver/SyncVarAccessLists.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| // tracks SyncVar read/write access when processing NetworkBehaviour, | ||||
| // to later be replaced by SyncVarAccessReplacer. | ||||
| using System.Collections.Generic; | ||||
| using Mono.CecilX; | ||||
|  | ||||
| namespace Mirror.Weaver | ||||
| { | ||||
|     // This data is flushed each time - if we are run multiple times in the same process/domain | ||||
|     public class SyncVarAccessLists | ||||
|     { | ||||
|         // setter functions that replace [SyncVar] member variable references. dict<field, replacement> | ||||
|         public Dictionary<FieldDefinition, MethodDefinition> replacementSetterProperties = | ||||
|             new Dictionary<FieldDefinition, MethodDefinition>(); | ||||
|  | ||||
|         // getter functions that replace [SyncVar] member variable references. dict<field, replacement> | ||||
|         public Dictionary<FieldDefinition, MethodDefinition> replacementGetterProperties = | ||||
|             new Dictionary<FieldDefinition, MethodDefinition>(); | ||||
|  | ||||
|         // amount of SyncVars per class. dict<className, amount> | ||||
|         // necessary for SyncVar dirty bits, where inheriting classes start | ||||
|         // their dirty bits at base class SyncVar amount. | ||||
|         public Dictionary<string, int> numSyncVars = new Dictionary<string, int>(); | ||||
|  | ||||
|         public int GetSyncVarStart(string className) => | ||||
|             numSyncVars.TryGetValue(className, out int value) ? value : 0; | ||||
|  | ||||
|         public void SetNumSyncVars(string className, int num) | ||||
|         { | ||||
|             numSyncVars[className] = num; | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 DerTyp187
					DerTyp187