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