> 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.ksiscripttemplate.md).

# Interface ksIScriptTemplate

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

Interface for templates from which scripts can be generated.

```csharp
public interface ksIScriptTemplate
```

## Properties

### DefaultFileName <a href="#ks_reactor_client_unity_editor_ksiscripttemplate_defaultfilename" id="ks_reactor_client_unity_editor_ksiscripttemplate_defaultfilename"></a>

Default file name for scripts generated from this template.

```csharp
string DefaultFileName { get; }
```

#### Property Value

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

### DefaultPath <a href="#ks_reactor_client_unity_editor_ksiscripttemplate_defaultpath" id="ks_reactor_client_unity_editor_ksiscripttemplate_defaultpath"></a>

Default path for scripts generated from this template.

```csharp
string DefaultPath { get; }
```

#### Property Value

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

### Generator <a href="#ks_reactor_client_unity_editor_ksiscripttemplate_generator" id="ks_reactor_client_unity_editor_ksiscripttemplate_generator"></a>

Script generator

```csharp
ksScriptGenerator Generator { get; set; }
```

#### Property Value

[ksScriptGenerator](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksscriptgenerator.md)

### OptionalMethods <a href="#ks_reactor_client_unity_editor_ksiscripttemplate_optionalmethods" id="ks_reactor_client_unity_editor_ksiscripttemplate_optionalmethods"></a>

Optional methods the template can generate.

```csharp
ksOptionalMethod[] OptionalMethods { get; }
```

#### Property Value

[ksOptionalMethod](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksoptionalmethod.md)\[]

## Methods

### Generate(string, string, string, HashSet\<uint>) <a href="#ks_reactor_client_unity_editor_ksiscripttemplate_generate_system_string_system_string_system_string" id="ks_reactor_client_unity_editor_ksiscripttemplate_generate_system_string_system_string_system_string"></a>

Generates the contents of a script.

```csharp
string Generate(string path, string className, string scriptNamespace, HashSet<uint> optionalMethods)
```

#### Parameters

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

Path the script will be written to.

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

Name of generated class.

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

Namespace of generated class.

`optionalMethods` [HashSet](https://learn.microsoft.com/dotnet/api/system.collections.generic.hashset-1)<[uint](https://learn.microsoft.com/dotnet/api/system.uint32)>

Contains ids of optional method stubs to generate.

#### Returns

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

Script contents

### HandleCreate(string, string, string) <a href="#ks_reactor_client_unity_editor_ksiscripttemplate_handlecreate_system_string_system_string_system_str" id="ks_reactor_client_unity_editor_ksiscripttemplate_handlecreate_system_string_system_string_system_str"></a>

Called after the script file is written.

```csharp
void HandleCreate(string path, string className, string scriptNamespace)
```

#### Parameters

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

Path the script was written to.

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

Name of generated class.

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

Namespace of generated class.
