spaar / besiege-modloader

spaar's Mod Loader for Besiege - Deprecated
Other
57 stars 14 forks source link

SingleInstance bug when reloading mod #37

Closed spaar closed 8 years ago

spaar commented 8 years ago

SingleInstance throws a NullReferenceExcpetion in CreateOrFind when a mod that accesses Instance in OnLoad is reloaded using the debug helper. The AddComponent call returns null for some reason. Attempting to get the component afterwards using GetComponent also returns null, however the component is properly displayed in the object explorer. This suggests it is added, but only accessible after some time (next frame?) or not by specifically trying to access this component but only when using something like the more general GetComponents<Component>() that's used in the object explorer. Additional debugging is required.