---
tags:
    - "UI, User, Interface"
---

# Graphic Set Native Size

[UI](../index.md) / [Graphic](index.md) / **Graphic Set Native Size**

## Description

Executes the Set Native Size method on the Graphic component

## 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("Graphic Set Native Size")]
    [Category("UI/Graphic/Set Native Size")]
    [Description("Executes the Set Native Size method on the Graphic component")]
    
    [Image(typeof(IconBrush), ColorTheme.Type.TextLight)]
    [Keywords("UI, User, Interface")]
    
    [Serializable]
    public class GenInstructionGraphic_SetNativeSize_0 : Instruction
    {
        [SerializeField] private GetGameObject m_Graphic = new GetGameObject(
            new GenTypeGameObject_Graphic()
        );
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Set Native Size");
            return $"{this.m_Graphic} {method}";
        }
        
        protected override Awaitable Run(Args args)
        {
            Graphic component = this.m_Graphic.Get<Graphic>(args);
            if (component == null) return Done;
            
            component.SetNativeSize();
            
            return Done;
        }
    }
}


```

