Click or drag to resize

ConfigAccessorReadFieldsFromFile Method

Reads values of the annotated persistent fields from a config file.

Namespace:  KSPDev.ConfigUtils
Assembly:  KSPDev_Utils.1.1 (in KSPDev_Utils.1.1.dll) Version: 1.1 for KSP v1.6+
Syntax
C#
public static void ReadFieldsFromFile(
	string filePath,
	Type type,
	Object instance,
	string nodePath = null,
	string group = ""
)
Request Example View Source

Parameters

filePath
Type: SystemString
A relative or an absolute path to the file. It's resolved via MakeAbsPathForGameData(String).
type
Type: SystemType
A type to load fields for.
instance
Type: SystemObject
An instance of type type. If it's null then only static fields will be loaded.
nodePath (Optional)
Type: SystemString
An optional path in the file. All type's field will be read relative to this part.
group (Optional)
Type: SystemString
A group tag (see BasePersistentFieldAttribute).
See Also