Renderer Is Visible#
Mesh / Renderer / Renderer Is Visible
Can Read
Cannot Write
Description#
The Is Visible property of the 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;
namespace VisualScript.Runtime
{
[Get]
[Title("Renderer Is Visible")]
[Category("Mesh/Renderer/Is Visible")]
[Description("The Is Visible property of the Renderer component")]
[Image(typeof(IconMesh), ColorTheme.Type.Blue)]
[Serializable]
public class GenTypeBool_Renderer_IsVisible : TypeBool
{
[SerializeField] private GetGameObject m_Renderer = new GetGameObject(
new GenTypeGameObject_Renderer()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_Renderer.GetPreview(source);
if (instance == null) return default;
Renderer component = instance.GetComponent<Renderer>();
return component != null ? component.isVisible : default;
}
public override bool Get(Args args)
{
Renderer instance = this.m_Renderer.Get<Renderer>(args);
return instance != null
? instance.isVisible
: default;
}
public override string ToString()
{
return $"{this.m_Renderer} Is Visible";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}