# GetEndProperty

> Retrieves the SerializedProperty that defines the end range of this property.

## Definition

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

## GetEndProperty()

Retrieves the SerializedProperty that defines the end range of this property.

```csharp
public SerializedProperty GetEndProperty()
```

### Returns

| Type                                                                                    | Description |
| --------------------------------------------------------------------------------------- | ----------- |
| [SerializedProperty](/engine/6000.7/script-reference/unityeditor/serializedproperty.md) |             |

### Remarks

It's the first property that's not a child or grandchild of this property. The end property can be used to iterate over all children of a property by using [SerializedProperty.EqualContents](/engine/6000.7/script-reference/unityeditor/serializedproperty/equalcontents.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

public class GetEndPropertyExample : ScriptableObject
{
    public Vector2 m_vector2 = new Vector2(1.0f, 2.0f);
    public bool m_bool = false;

    [MenuItem("Example/SerializedProperty GetEndProperty Example")]
    static void Example()
    {
        GetEndPropertyExample obj = ScriptableObject.CreateInstance<GetEndPropertyExample>();
        SerializedObject serializedObject = new SerializedObject(obj);
        SerializedProperty property = serializedObject.FindProperty("m_vector2");

        // Visit the x, y values of the vector, stopping once m_bool is reached
        var endOfChildrenIteration = property.GetEndProperty();
        while (property.NextVisible(true) && !SerializedProperty.EqualContents(property, endOfChildrenIteration))
        {
            Debug.Log(property.propertyPath + " : " + property.floatValue);
        }
    }
}
```

## GetEndProperty(bool)

Retrieves the SerializedProperty that defines the end range of this property.

```csharp
public SerializedProperty GetEndProperty(bool includeInvisible)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)):&#x20;

### Returns

| Type                                                                                    | Description |
| --------------------------------------------------------------------------------------- | ----------- |
| [SerializedProperty](/engine/6000.7/script-reference/unityeditor/serializedproperty.md) |             |

### Remarks

It's the first property that's not a child or grandchild of this property. The end property can be used to iterate over all children of a property by using [SerializedProperty.EqualContents](/engine/6000.7/script-reference/unityeditor/serializedproperty/equalcontents.md).

### Examples

```csharp
using UnityEditor;
using UnityEngine;

public class GetEndPropertyExample : ScriptableObject
{
    public Vector2 m_vector2 = new Vector2(1.0f, 2.0f);
    public bool m_bool = false;

    [MenuItem("Example/SerializedProperty GetEndProperty Example")]
    static void Example()
    {
        GetEndPropertyExample obj = ScriptableObject.CreateInstance<GetEndPropertyExample>();
        SerializedObject serializedObject = new SerializedObject(obj);
        SerializedProperty property = serializedObject.FindProperty("m_vector2");

        // Visit the x, y values of the vector, stopping once m_bool is reached
        var endOfChildrenIteration = property.GetEndProperty();
        while (property.NextVisible(true) && !SerializedProperty.EqualContents(property, endOfChildrenIteration))
        {
            Debug.Log(property.propertyPath + " : " + property.floatValue);
        }
    }
}
```
