# GetPropertyOptionalInt

> Searches for property and assigns it's value to given variable.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.3/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

## GetPropertyOptionalInt(string, int, BuildTargetGroup)

Searches for property and assigns it's value to given variable.

> **Warning:**
>
> **Deprecated.** Use explicit API instead.

```csharp
public static bool GetPropertyOptionalInt(string name, ref int value, BuildTargetGroup target)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Name of the property.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Variable, to which to store the value of the property, if set.**** (\[BuildTargetGroup]\(/engine/6000.3/script-reference/unityeditor/buildtargetgroup)): An optional build target group, to which the property applies.

### Returns

| Type                                                          | Description                                                         |
| ------------------------------------------------------------- | ------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if property was set and it's value assigned to given variable. |

### Remarks

Property is not required to exist. If it doesn't exist, value variable will not be changed and this method will return false.

## GetPropertyOptionalInt(string, int)

Searches for property and assigns it's value to given variable.

> **Warning:**
>
> **Deprecated.** Use explicit API instead.

```csharp
public static bool GetPropertyOptionalInt(string name, ref int value)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Name of the property.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Variable, to which to store the value of the property, if set.

### Returns

| Type                                                          | Description                                                         |
| ------------------------------------------------------------- | ------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if property was set and it's value assigned to given variable. |

### Remarks

Property is not required to exist. If it doesn't exist, value variable will not be changed and this method will return false.
