---
tags:
    - "UI, Layout"
---

# Rect Transform Set Inset And Size From Parent Edge

[UI](../../index.md) / [Layout](../index.md) / [Rect Transform](index.md) / **Rect Transform Set Inset And Size From Parent Edge**

## Description

Executes the Set Inset And Size From Parent Edge method on the Rect Transform component

## Parameters

| Name | Description |
| :--- | :---------- |
| Edge |  |
| Inset |  |
| Size |  |

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.UI;

namespace VisualScript.Runtime
{
    [Title("Rect Transform Set Inset And Size From Parent Edge")]
    [Category("UI/Layout/Rect Transform/Set Inset And Size From Parent Edge")]
    [Description("Executes the Set Inset And Size From Parent Edge method on the Rect Transform component")]
    
    [Image(typeof(IconRectTransform), ColorTheme.Type.TextLight)]
    [Keywords("UI, Layout")]
    
    [Parameter("Edge")]
    [Parameter("Inset")]
    [Parameter("Size")]
    
    [Serializable]
    public class GenInstructionRectTransform_SetInsetAndSizeFromParentEdge_3 : Instruction
    {
        [SerializeField] private GetGameObject m_RectTransform = new GetGameObject(
            new GenTypeGameObject_RectTransform()
        );
        
        [SerializeField] private RectTransform.Edge m_Edge = default;
        
        [SerializeField] private GetNumber m_Inset = new GetNumber();
        
        [SerializeField] private GetNumber m_Size = new GetNumber();
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Set Inset And Size From Parent Edge");
            return $"{this.m_RectTransform} {method} ({this.m_Edge}, {this.m_Inset}, {this.m_Size})";
        }
        
        protected override Awaitable Run(Args args)
        {
            RectTransform component = this.m_RectTransform.Get<RectTransform>(args);
            if (component == null) return Done;
            
            component.SetInsetAndSizeFromParentEdge(
                this.m_Edge,
                (float) this.m_Inset.Get(args),
                (float) this.m_Size.Get(args)
            );
            
            return Done;
        }
    }
}


```

