> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksconfigwriter.md).

# Class ksConfigWriter

Namespace: [KS.Reactor.Client.Unity.Editor](/reactor/api-reference/ks.reactor.client.unity.editor.md)\
Assembly: KSUnity-Source.dll

Performs compile/build operations and writes game and scene JSON config files and geometry data.

```csharp
public class ksConfigWriter
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† [ksConfigWriter](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksconfigwriter.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Properties

### PrettyConfigs <a href="#ks_reactor_client_unity_editor_ksconfigwriter_prettyconfigs" id="ks_reactor_client_unity_editor_ksconfigwriter_prettyconfigs"></a>

Get / Set pretty JSON config writing.

```csharp
public bool PrettyConfigs { get; set; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### ScenePublishing <a href="#ks_reactor_client_unity_editor_ksconfigwriter_scenepublishing" id="ks_reactor_client_unity_editor_ksconfigwriter_scenepublishing"></a>

Data required for scene publishing API calls

```csharp
public ksJSON ScenePublishing { get; }
```

#### Property Value

[ksJSON](/reactor/api-reference/ks.reactor/ks.reactor.ksjson.md)

### SceneTracker <a href="#ks_reactor_client_unity_editor_ksconfigwriter_scenetracker" id="ks_reactor_client_unity_editor_ksconfigwriter_scenetracker"></a>

Set the scriptable object that is used for tracking scene changes.

```csharp
public static ksSceneTracker SceneTracker { set; }
```

#### Property Value

[ksSceneTracker](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksscenetracker.md)

### Summary <a href="#ks_reactor_client_unity_editor_ksconfigwriter_summary" id="ks_reactor_client_unity_editor_ksconfigwriter_summary"></a>

Get the build summary.

```csharp
public string Summary { get; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

## Methods

### Build(bool, bool, bool, Configurations, bool) <a href="#ks_reactor_client_unity_editor_ksconfigwriter_build_system_boolean_system_boolean_system_boolean_ks" id="ks_reactor_client_unity_editor_ksconfigwriter_build_system_boolean_system_boolean_system_boolean_ks"></a>

Build the project.

```csharp
public bool Build(bool buildConfigs = true, bool buildRuntime = true, bool rebuildAllConfigs = true, ksServerScriptCompiler.Configurations runtimeConfig = Configurations.LOCAL_RELEASE, bool regenProjectFiles = false)
```

#### Parameters

`buildConfigs` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Build server configs files when this parameter is true.

`buildRuntime` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Build the server runtime when this parameter is true.

`rebuildAllConfigs` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Rebuild all server config files when `buildConfigs` is true.

`runtimeConfig` [ksServerScriptCompiler](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler.md).[Configurations](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksserverscriptcompiler/ks.reactor.client.unity.editor.ksserverscriptcompiler.configurations.md)

Sets the runtime configuration to build when `buildRuntime` is true.

`regenProjectFiles` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

Regenerate the runtime solution and project files.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if no errors were encountered.

### CacheGeometry(ksEntityComponent, ksIUnityCollider, Dictionary\<int, ksIUnityCollider>) <a href="#ks_reactor_client_unity_editor_ksconfigwriter_cachegeometry_ks_reactor_client_unity_ksentitycomponen" id="ks_reactor_client_unity_editor_ksconfigwriter_cachegeometry_ks_reactor_client_unity_ksentitycomponen"></a>

Extract and cache the geometry data from a ksCollider. Uses the prefab cache only.

```csharp
public void CacheGeometry(ksEntityComponent entity, ksIUnityCollider collider, Dictionary<int, ksIUnityCollider> shapeMap)
```

#### Parameters

`entity` [ksEntityComponent](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksentitycomponent.md)

Entity the collider is from.

`collider` [ksIUnityCollider](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksiunitycollider.md)

Collider to extract geometry from.

`shapeMap` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)<[int](https://learn.microsoft.com/dotnet/api/system.int32), [ksIUnityCollider](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksiunitycollider.md)>

Map of IDs to shapes. Used to prevent ID collisions.

### CacheGeometry(ksEntityComponent, ksIUnityCollider, bool, Dictionary\<int, ksIUnityCollider>, ref int) <a href="#ks_reactor_client_unity_editor_ksconfigwriter_cachegeometry_ks_reactor_client_unity_ksentitycomponen" id="ks_reactor_client_unity_editor_ksconfigwriter_cachegeometry_ks_reactor_client_unity_ksentitycomponen"></a>

Extract and cache the geometry data from a [ksIUnityCollider](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksiunitycollider.md).

```csharp
public int CacheGeometry(ksEntityComponent entity, ksIUnityCollider collider, bool useInstanceGeometry, Dictionary<int, ksIUnityCollider> shapeMap, ref int nextId)
```

#### Parameters

`entity` [ksEntityComponent](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksentitycomponent.md)

Entity the collider is from.

`collider` [ksIUnityCollider](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksiunitycollider.md)

Collider to extract geometry from.

`useInstanceGeometry` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

if true, will check the instance cache if geometry is not found in the prefab cache, and will store geometry in the instance cache if it's not found in either cache.

`shapeMap` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)<[int](https://learn.microsoft.com/dotnet/api/system.int32), [ksIUnityCollider](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksiunitycollider.md)>

Map of IDs to shapes. Used to prevent ID collisions. Not used if `useInstanceGeometry` is true.

`nextId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

ID to assign if a new ID is needed. Will increment this number until an unused ID is found. Not used if `useInstanceGeometry`is true. Instead a negative ID is assigned.

#### Returns

[int](https://learn.microsoft.com/dotnet/api/system.int32)

Shape ID

### CreateGameJson() <a href="#ks_reactor_client_unity_editor_ksconfigwriter_creategamejson" id="ks_reactor_client_unity_editor_ksconfigwriter_creategamejson"></a>

Creates the game config file.

```csharp
public ksJSON CreateGameJson()
```

#### Returns

[ksJSON](/reactor/api-reference/ks.reactor/ks.reactor.ksjson.md)

JSON game config

### CreateSceneJson() <a href="#ks_reactor_client_unity_editor_ksconfigwriter_createscenejson" id="ks_reactor_client_unity_editor_ksconfigwriter_createscenejson"></a>

Iterate through game objects in the hierarchy and creates the scene config.

```csharp
public ksJSON CreateSceneJson()
```

#### Returns

[ksJSON](/reactor/api-reference/ks.reactor/ks.reactor.ksjson.md)

JSON scene config
