Canvas Override Pixel Perfect#
UI / Layout / Canvas / Canvas Override Pixel Perfect
Can Read
Can Write
Description#
The Override Pixel Perfect property of the Canvas component
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
{
[Get]
[Set]
[Title("Canvas Override Pixel Perfect")]
[Category("UI/Layout/Canvas/Override Pixel Perfect")]
[Description("The Override Pixel Perfect property of the Canvas component")]
[Image(typeof(IconCanvas), ColorTheme.Type.TextLight)]
[Keywords("UI, Layout")]
[Serializable]
public class GenTypeBool_Canvas_OverridePixelPerfect : TypeBool
{
[SerializeField] private GetGameObject m_Canvas = new GetGameObject(
new GenTypeGameObject_Canvas()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_Canvas.GetPreview(source);
if (instance == null) return default;
Canvas component = instance.GetComponent<Canvas>();
return component != null ? component.overridePixelPerfect : default;
}
public override bool Get(Args args)
{
Canvas instance = this.m_Canvas.Get<Canvas>(args);
return instance != null
? instance.overridePixelPerfect
: default;
}
public override void Set(bool value, Args args)
{
Canvas component = this.m_Canvas.Get<Canvas>(args);
if (component != null) component.overridePixelPerfect = (bool) value;
}
public override string ToString()
{
return $"{this.m_Canvas} Override Pixel Perfect";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}