API:KSPField

From Kerbal Space Program Wiki
Revision as of 17:12, 22 January 2020 by Rocketdocker (talk | contribs) ({{Orphan}})
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This page is an orphan, as no other articles link to it.


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.