Canvas Renderer Cull#
Rendering / Canvas Renderer / Canvas Renderer Cull
Can Read
Can Write
Description#
The Cull property of the Canvas Renderer 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.Rendering;
namespace VisualScript.Runtime
{
[Get]
[Set]
[Title("Canvas Renderer Cull")]
[Category("Rendering/Canvas Renderer/Cull")]
[Description("The Cull property of the Canvas Renderer component")]
[Image(typeof(IconEye), ColorTheme.Type.TextLight)]
[Serializable]
public class GenTypeBool_CanvasRenderer_Cull : TypeBool
{
[SerializeField] private GetGameObject m_CanvasRenderer = new GetGameObject(
new GenTypeGameObject_CanvasRenderer()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_CanvasRenderer.GetPreview(source);
if (instance == null) return default;
CanvasRenderer component = instance.GetComponent<CanvasRenderer>();
return component != null ? component.cull : default;
}
public override bool Get(Args args)
{
CanvasRenderer instance = this.m_CanvasRenderer.Get<CanvasRenderer>(args);
return instance != null
? instance.cull
: default;
}
public override void Set(bool value, Args args)
{
CanvasRenderer component = this.m_CanvasRenderer.Get<CanvasRenderer>(args);
if (component != null) component.cull = (bool) value;
}
public override string ToString()
{
return $"{this.m_CanvasRenderer} Cull";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}