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

# Aspect Ratio Fitter Aspect Ratio

[UI](../../index.md) / [Layout](../index.md) / [Aspect Ratio Fitter](index.md) / **Aspect Ratio Fitter Aspect Ratio**

## Description

Compares the Aspect Ratio property of Aspect Ratio Fitter component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Aspect Ratio Fitter |  |
| Compare |  |
| Value |  |

## 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("Aspect Ratio Fitter Aspect Ratio")]
    [Category("UI/Layout/Aspect Ratio Fitter/Aspect Ratio")]
    [Description("Compares the Aspect Ratio property of Aspect Ratio Fitter component to another value")]
    
    [Image(typeof(IconAspectRatioFitter), ColorTheme.Type.TextLight)]
    [Keywords("UI, Layout")]
    
    [Parameter("Aspect Ratio Fitter")]
    [Parameter("Compare")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenConditionNumber_AspectRatioFitter_CheckAspectRatio : Condition
    {
        [SerializeField] private GetGameObject m_AspectRatioFitter = new GetGameObject(
            new GenTypeGameObject_AspectRatioFitter()
        );
        
        [SerializeField] private CompareNumber m_Compare = new CompareNumber();
        
        [SerializeField] private GetNumber m_Value = new GetNumber();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Aspect Ratio");
            return $"{this.m_AspectRatioFitter} {member} {this.m_Compare} {this.m_Value}";
        }
        
        protected override bool Run(Args args)
        {
            AspectRatioFitter component = this.m_AspectRatioFitter.Get<AspectRatioFitter>(args);
            if (component == null) return false;
            
            return this.m_Compare.Compare(component.aspectRatio, (float) this.m_Value.Get(args));
        }
    }
}


```

