Difference between revisions of "API:KSPField"
From Kerbal Space Program Wiki
(Minimal documentation of KSPField) |
Rocketdocker (talk | contribs) ({{Orphan}}) |
||
Line 1: | Line 1: | ||
+ | {{Orphan}} | ||
[https://kerbalspaceprogram.com/api/class_k_s_p_field.html <code>KSPField</code>] is a C# annotation that may be applied to member variables of [[API:Part]]s, [[API:PartModule]]s, etc to make their state persistent. | [https://kerbalspaceprogram.com/api/class_k_s_p_field.html <code>KSPField</code>] is a C# annotation that may be applied to member variables of [[API:Part]]s, [[API:PartModule]]s, etc to make their state persistent. | ||
Latest revision as of 17:12, 22 January 2020
KSPField
is a C# annotation that may be applied to member variables of API:Parts, API:PartModules, etc to make their state persistent.
e.g.
class MyBlingModule : PartModule { [KSPField()] protected double blingBrightness = 1000.0; //... }
adds a field that is exposed to ModuleManager
, saved and restored by KSP on load and unload, etc.