# SampleImportEventData

> Describes a single sample that was imported when the Sample.OnBeforeImportFinish event is raised.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEditor.PackageManager.UI](/engine/6000.7/script-reference/unityeditor/packagemanager/ui.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public struct SampleImportEventData
```

## Remarks

An array of [SampleImportEventData](/engine/6000.7/script-reference/unityeditor/packagemanager/ui/sampleimporteventdata.md) is passed to subscribers of [Sample.OnBeforeImportFinish](/engine/6000.7/script-reference/unityeditor/packagemanager/ui/sample/onbeforeimportfinish.md), with one entry per sample imported in the originating call to [Sample.Import](/engine/6000.7/script-reference/unityeditor/packagemanager/ui/sample/import.md). Use the data to react to imports — for example, by logging the destination path or chaining additional setup work before the Asset Database refresh runs.

```csharp
using UnityEditor;
using UnityEditor.PackageManager.UI;
using UnityEngine;

public static class SampleImportLogger
{
    [InitializeOnLoadMethod]
    static void Subscribe()
    {
        Sample.OnBeforeImportFinish += data =>
        {
            foreach (var entry in data)
                Debug.Log($"{entry.packageTechnicalName}: {entry.sampleDisplayName} -> {entry.newImportPath}");
        };
    }
}
```

Additional Resources: [Sample.OnBeforeImportFinish](/engine/6000.7/script-reference/unityeditor/packagemanager/ui/sample/onbeforeimportfinish.md), [Sample](/engine/6000.7/script-reference/unityeditor/packagemanager/ui/sample.md)

## Properties

| Property                                                                                                                            | Description                                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| [newImportPath](/engine/6000.7/script-reference/unityeditor/packagemanager/ui/sampleimporteventdata/newimportpath.md)               | The full path the sample was imported to, under the project's `Assets` folder.                      |
| [oldImportPath](/engine/6000.7/script-reference/unityeditor/packagemanager/ui/sampleimporteventdata/oldimportpath.md)               | The path of a previous import of this sample, or `null` if the sample had not been imported before. |
| [packageTechnicalName](/engine/6000.7/script-reference/unityeditor/packagemanager/ui/sampleimporteventdata/packagetechnicalname.md) | The technical name (ID) of the package the sample belongs to.                                       |
| [sampleDisplayName](/engine/6000.7/script-reference/unityeditor/packagemanager/ui/sampleimporteventdata/sampledisplayname.md)       | The display name of the imported sample.                                                            |
