Renderer Is Part Of Static Batch#
Mesh / Renderer / Renderer Is Part Of Static Batch
Can Read
Cannot Write
Description#
The Is Part Of Static Batch 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 Part Of Static Batch")]
[Category("Mesh/Renderer/Is Part Of Static Batch")]
[Description("The Is Part Of Static Batch property of the Renderer component")]
[Image(typeof(IconMesh), ColorTheme.Type.Blue)]
[Serializable]
public class GenTypeBool_Renderer_IsPartOfStaticBatch : 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.isPartOfStaticBatch : default;
}
public override bool Get(Args args)
{
Renderer instance = this.m_Renderer.Get<Renderer>(args);
return instance != null
? instance.isPartOfStaticBatch
: default;
}
public override string ToString()
{
return $"{this.m_Renderer} Is Part Of Static Batch";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}