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

# Class ksNewScriptMenu

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

Editor window for creating scripts from a template.

```csharp
public class ksNewScriptMenu : EditorWindow
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← Object ← ScriptableObject ← EditorWindow ← [ksNewScriptMenu](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksnewscriptmenu.md)

#### Inherited Members

EditorWindow\.BeginWindows(), EditorWindow\.EndWindows(), EditorWindow\.ShowNotification(GUIContent), EditorWindow\.ShowNotification(GUIContent, double), EditorWindow\.RemoveNotification(), EditorWindow\.ShowTab(), EditorWindow\.Focus(), EditorWindow\.ShowUtility(), EditorWindow\.ShowPopup(), EditorWindow\.ShowModalUtility(), EditorWindow\.ShowAsDropDown(Rect, Vector2), EditorWindow\.Show(), EditorWindow\.Show(bool), EditorWindow\.ShowAuxWindow(), EditorWindow\.ShowModal(), EditorWindow\.GetWindow(Type, bool, string, bool), EditorWindow\.GetWindow(Type, bool, string), EditorWindow\.GetWindow(Type, bool), EditorWindow\.GetWindow(Type), EditorWindow\.GetWindowWithRect(Type, Rect, bool, string), EditorWindow\.GetWindowWithRect(Type, Rect, bool), EditorWindow\.GetWindowWithRect(Type, Rect), EditorWindow\.GetWindow\<T>(), EditorWindow\.GetWindow\<T>(bool), EditorWindow\.GetWindow\<T>(bool, string), EditorWindow\.GetWindow\<T>(string), EditorWindow\.GetWindow\<T>(string, bool), EditorWindow\.GetWindow\<T>(bool, string, bool), EditorWindow\.GetWindow\<T>(params Type\[]), EditorWindow\.GetWindow\<T>(string, params Type\[]), EditorWindow\.GetWindow\<T>(string, bool, params Type\[]), EditorWindow\.CreateWindow\<T>(params Type\[]), EditorWindow\.CreateWindow\<T>(string, params Type\[]), EditorWindow\.HasOpenInstances\<T>(), EditorWindow\.FocusWindowIfItsOpen(Type), EditorWindow\.FocusWindowIfItsOpen\<T>(), EditorWindow\.GetWindowWithRect\<T>(Rect), EditorWindow\.GetWindowWithRect\<T>(Rect, bool), EditorWindow\.GetWindowWithRect\<T>(Rect, bool, string), EditorWindow\.GetWindowWithRect\<T>(Rect, bool, string, bool), EditorWindow\.SaveChanges(), EditorWindow\.DiscardChanges(), EditorWindow\.Close(), EditorWindow\.Repaint(), EditorWindow\.SendEvent(Event), EditorWindow\.GetExtraPaneTypes(), EditorWindow\.TryGetOverlay(string, out Overlay), EditorWindow\.OnBackingScaleFactorChanged(), EditorWindow\.dataModeController, EditorWindow\.rootVisualElement, EditorWindow\.overlayCanvas, EditorWindow\.wantsMouseMove, EditorWindow\.wantsMouseEnterLeaveWindow, EditorWindow\.wantsLessLayoutEvents, EditorWindow\.autoRepaintOnSceneChange, EditorWindow\.maximized, EditorWindow\.hasFocus, EditorWindow\.docked, EditorWindow\.focusedWindow, EditorWindow\.mouseOverWindow, EditorWindow\.hasUnsavedChanges, EditorWindow\.saveChangesMessage, EditorWindow\.minSize, EditorWindow\.maxSize, EditorWindow\.title, EditorWindow\.titleContent, EditorWindow\.depthBufferBits, EditorWindow\.antiAlias, EditorWindow\.position, ScriptableObject.SetDirty(), ScriptableObject.CreateInstance(string), ScriptableObject.CreateInstance(Type), ScriptableObject.CreateInstance\<T>(), Object.GetInstanceID(), Object.GetHashCode(), Object.Equals(object), Object.Instantiate(Object, Vector3, Quaternion), Object.Instantiate(Object, Vector3, Quaternion, Transform), Object.Instantiate(Object), Object.Instantiate(Object, Transform), Object.Instantiate(Object, Transform, bool), Object.Instantiate\<T>(T), Object.Instantiate\<T>(T, Vector3, Quaternion), Object.Instantiate\<T>(T, Vector3, Quaternion, Transform), Object.Instantiate\<T>(T, Transform), Object.Instantiate\<T>(T, Transform, bool), Object.Destroy(Object, float), Object.Destroy(Object), Object.DestroyImmediate(Object, bool), Object.DestroyImmediate(Object), Object.FindObjectsOfType(Type), Object.FindObjectsOfType(Type, bool), Object.FindObjectsByType(Type, FindObjectsSortMode), Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode), Object.DontDestroyOnLoad(Object), Object.DestroyObject(Object, float), Object.DestroyObject(Object), Object.FindSceneObjectsOfType(Type), Object.FindObjectsOfTypeIncludingAssets(Type), Object.FindObjectsOfType\<T>(), Object.FindObjectsByType\<T>(FindObjectsSortMode), Object.FindObjectsOfType\<T>(bool), Object.FindObjectsByType\<T>(FindObjectsInactive, FindObjectsSortMode), Object.FindObjectOfType\<T>(), Object.FindObjectOfType\<T>(bool), Object.FindFirstObjectByType\<T>(), Object.FindAnyObjectByType\<T>(), Object.FindFirstObjectByType\<T>(FindObjectsInactive), Object.FindAnyObjectByType\<T>(FindObjectsInactive), Object.FindObjectsOfTypeAll(Type), Object.FindObjectOfType(Type), Object.FindFirstObjectByType(Type), Object.FindAnyObjectByType(Type), Object.FindObjectOfType(Type, bool), Object.FindFirstObjectByType(Type, FindObjectsInactive), Object.FindAnyObjectByType(Type, FindObjectsInactive), Object.ToString(), Object.name, Object.hideFlags, [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

### Attach <a href="#ks_reactor_client_unity_editor_ksnewscriptmenu_attach" id="ks_reactor_client_unity_editor_ksnewscriptmenu_attach"></a>

Will the scripts be attached to one or more game objects once generated?

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

#### Property Value

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

### Path <a href="#ks_reactor_client_unity_editor_ksnewscriptmenu_path" id="ks_reactor_client_unity_editor_ksnewscriptmenu_path"></a>

Path to generate the script in (for non-attached scripts only).

```csharp
public string Path { get; set; }
```

#### Property Value

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

### Template <a href="#ks_reactor_client_unity_editor_ksnewscriptmenu_template" id="ks_reactor_client_unity_editor_ksnewscriptmenu_template"></a>

Template to generate the script from.

```csharp
public ksIScriptTemplate Template { get; set; }
```

#### Property Value

[ksIScriptTemplate](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksiscripttemplate.md)

## Methods

### OnDestroy() <a href="#ks_reactor_client_unity_editor_ksnewscriptmenu_ondestroy" id="ks_reactor_client_unity_editor_ksnewscriptmenu_ondestroy"></a>

Unity method called when the window is closed.

```csharp
public void OnDestroy()
```

### OnEnable() <a href="#ks_reactor_client_unity_editor_ksnewscriptmenu_onenable" id="ks_reactor_client_unity_editor_ksnewscriptmenu_onenable"></a>

Unity method called after restart.

```csharp
public void OnEnable()
```

### Open(ksIScriptTemplate, bool, string) <a href="#ks_reactor_client_unity_editor_ksnewscriptmenu_open_ks_reactor_client_unity_editor_ksiscripttemplate" id="ks_reactor_client_unity_editor_ksnewscriptmenu_open_ks_reactor_client_unity_editor_ksiscripttemplate"></a>

Initializes and opens the new script menu window. If a window is already open it will be focused and re-initialized.

```csharp
public static void Open(ksIScriptTemplate template, bool attach = true, string path = null)
```

#### Parameters

`template` [ksIScriptTemplate](/reactor/api-reference/ks.reactor.client.unity.editor/ks.reactor.client.unity.editor.ksiscripttemplate.md)

Template to generate the script from.

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

Will the scripts be attached to one or more game objects once they are generated?

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

Path to generate the script in (for non-attached scripts only).
