# PartsProvider

## KSP.Game.PartProvider

This class is the main provider for anything related to parts definitions and data.

#### `AddPartData(KSP.Sim.Definitions.PartCore jsonData, System.string rawJson)`

This method is used to add parts to the `PartProvider`. It asks for a `PartCore` and a raw json (from the same part core provided).

* `jsonData` - This argument requires a part core which is a class defining *almost* all the part's data, including all modules.
* `rawJson` - This argument requires a json equivalent to the `jsonData` provided. It should match exactly what you provide on the first argument.

#### Tips and Tricks

* You can either use [**JsonUtility**](https://docs.unity3d.com/ScriptReference/JsonUtility.ToJson.html) or [**newtonsoft's Json.Net**](https://www.newtonsoft.com/json/help/html/SerializeObject.htm) to get your `rawJson`.
* You can access it via `GameManager.Instance.Game.Parts`.

Categories: `Parts modding`, `Game systems`