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

# Image On Before Serialize

[UI](../../index.md) / [Graphic](../index.md) / [Image](index.md) / **Image On Before Serialize**

## Description

Executes the On Before Serialize method on the Image 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("Image On Before Serialize")]
    [Category("UI/Graphic/Image/On Before Serialize")]
    [Description("Executes the On Before Serialize method on the Image component")]
    
    [Image(typeof(IconUIImage), ColorTheme.Type.TextLight)]
    [Keywords("UI, User, Interface")]
    
    [Serializable]
    public class GenInstructionImage_OnBeforeSerialize_0 : Instruction
    {
        [SerializeField] private GetGameObject m_Image = new GetGameObject(
            new GenTypeGameObject_Image()
        );
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("On Before Serialize");
            return $"{this.m_Image} {method}";
        }
        
        protected override Awaitable Run(Args args)
        {
            Image component = this.m_Image.Get<Image>(args);
            if (component == null) return Done;
            
            component.OnBeforeSerialize();
            
            return Done;
        }
    }
}


```

