# ApplyTo

> Applies this preset to a target object.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Presets](/engine/7000.0/script-reference/unityeditor/presets.md)
* **Assembly:** UnityEditor.CoreModule

## ApplyTo(Object)

Applies this preset to a target object.

```csharp
public bool ApplyTo(Object target)
```

### Parameters

**** (\[Object]\(/engine/7000.0/script-reference/unityengine/object)): The object to update with the serialized values of the preset.

### Returns

| Type                                                          | Description                                              |
| ------------------------------------------------------------- | -------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the preset updated the target. Otherwise, false. |

### Remarks

To check whether the preset can apply to a target, use [Preset.CanBeAppliedTo](/engine/7000.0/script-reference/unityeditor/presets/preset/canbeappliedto.md). To apply only some properties, use the overload that takes `selectedPropertyPaths`.

## ApplyTo(Object, string\[])

Applies the values of selected properties of this preset to a target object.

```csharp
public bool ApplyTo(Object target, string[] selectedPropertyPaths)
```

### Parameters

**** (\[Object]\(/engine/7000.0/script-reference/unityengine/object)): The object to update with the serialized values of the preset.**** (\[string\[]]\(https\://learn.microsoft.com/dotnet/api/system.string)): The property paths of the values to apply.

### Returns

| Type                                                          | Description                                              |
| ------------------------------------------------------------- | -------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the preset updated the target. Otherwise, false. |

### Remarks

To check whether the preset can apply to a target, use [Preset.CanBeAppliedTo](/engine/7000.0/script-reference/unityeditor/presets/preset/canbeappliedto.md). The method applies only the properties in `selectedPropertyPaths`.
