> 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.unity.editor/ks.unity.editor.kseditorevents.md).

# Class ksEditorEvents

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

Useful editor events that Unity doesn't provide.

```csharp
public class ksEditorEvents : AssetPostprocessor
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← AssetPostprocessor ← [ksEditorEvents](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorevents.md)

#### Inherited Members

AssetPostprocessor.LogWarning(string), AssetPostprocessor.LogWarning(string, Object), AssetPostprocessor.LogError(string), AssetPostprocessor.LogError(string, Object), AssetPostprocessor.GetVersion(), AssetPostprocessor.GetPostprocessOrder(), AssetPostprocessor.assetPath, AssetPostprocessor.context, AssetPostprocessor.assetImporter, [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)

## Constructors

### ksEditorEvents() <a href="#ks_unity_editor_kseditorevents__ctor" id="ks_unity_editor_kseditorevents__ctor"></a>

Constructor

```csharp
public ksEditorEvents()
```

### OnCompileStart <a href="#ks_unity_editor_kseditorevents_oncompilestart" id="ks_unity_editor_kseditorevents_oncompilestart"></a>

Invoked right before Unity compiles scripts. From script's point of view, once scripts are compiled Unity restarts, so use this to run code before the restart.

```csharp
public static event ksEditorEvents.CompileStartHandler OnCompileStart
```

#### Event Type

[ksEditorEvents](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorevents.md).[CompileStartHandler](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorevents/ks.unity.editor.kseditorevents.compilestarthandler.md)

### OnFocusChange <a href="#ks_unity_editor_kseditorevents_onfocuschange" id="ks_unity_editor_kseditorevents_onfocuschange"></a>

Invoked when the Unity application gains or loses focus.

```csharp
public static event ksEditorEvents.FocusChangeHandler OnFocusChange
```

#### Event Type

[ksEditorEvents](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorevents.md).[FocusChangeHandler](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorevents/ks.unity.editor.kseditorevents.focuschangehandler.md)

### OnImportAssets <a href="#ks_unity_editor_kseditorevents_onimportassets" id="ks_unity_editor_kseditorevents_onimportassets"></a>

Invoked when assets are moved or imported.

```csharp
public static event ksEditorEvents.ImportAssetsHandler OnImportAssets
```

#### Event Type

[ksEditorEvents](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorevents.md).[ImportAssetsHandler](/reactor/api-reference/ks.unity.editor/ks.unity.editor.kseditorevents/ks.unity.editor.kseditorevents.importassetshandler.md)
