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

# Canvas Scaler Reference Resolution

[UI](../../index.md) / [Layout](../index.md) / [Canvas Scaler](index.md) / **Canvas Scaler Reference Resolution**

## Description

Compares the Reference Resolution property of Canvas Scaler component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Canvas Scaler |  |
| 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("Canvas Scaler Reference Resolution")]
    [Category("UI/Layout/Canvas Scaler/Reference Resolution")]
    [Description("Compares the Reference Resolution property of Canvas Scaler component to another value")]
    
    [Image(typeof(IconCanvasScaler), ColorTheme.Type.TextLight)]
    [Keywords("UI, Layout")]
    
    [Parameter("Canvas Scaler")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenConditionVector2_CanvasScaler_CheckReferenceResolution : Condition
    {
        [SerializeField] private GetGameObject m_CanvasScaler = new GetGameObject(
            new GenTypeGameObject_CanvasScaler()
        );
        
        [SerializeField] private GetVector2 m_Value = new GetVector2();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Reference Resolution");
            return $"{this.m_CanvasScaler} {member} = {this.m_Value}";
        }
        
        protected override bool Run(Args args)
        {
            CanvasScaler component = this.m_CanvasScaler.Get<CanvasScaler>(args);
            if (component == null) return false;
            
            return component.referenceResolution == (Vector2) this.m_Value.Get(args);
        }
    }
}


```

