ConfigAccessorReadPartConfig Method |
Namespace: KSPDev.ConfigUtils
public static void ReadPartConfig( PartModule module, ConfigNode cfgNode )
The consumer code must call this method from the OnLoad method to capture the PartLoader initalization. This method automatically detects the game loading phase, so it's safe to call it in every OnLoad inovacation.
public class ReadPartConfigExample : PartModule { public override void OnAwake() { base.OnAwake(); // get hthe custom fields from the prefab. ConfigAccessor.CopyPartConfigFromPrefab(this); } public override void OnLoad(ConfigNode node) { base.OnLoad(node); // Load part's config custom fields in the scenes that clone the parts. ConfigAccessor.ReadPartConfig(this, node); } }