LOD Group Lod Count#
Rendering / LOD Group / LOD Group Lod Count
Can Read
Cannot Write
Description#
The Lod Count property of the LOD Group 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]
[Title("LOD Group Lod Count")]
[Category("Rendering/LOD Group/Lod Count")]
[Description("The Lod Count property of the LOD Group component")]
[Image(typeof(IconLOD), ColorTheme.Type.Blue)]
[Serializable]
public class GenTypeInteger_LODGroup_LodCount : TypeNumber
{
[SerializeField] private GetGameObject m_LODGroup = new GetGameObject(
new GenTypeGameObject_LODGroup()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_LODGroup.GetPreview(source);
if (instance == null) return default;
LODGroup component = instance.GetComponent<LODGroup>();
return component != null ? component.lodCount : default;
}
public override double Get(Args args)
{
LODGroup instance = this.m_LODGroup.Get<LODGroup>(args);
return instance != null
? instance.lodCount
: default;
}
public override string ToString()
{
return $"{this.m_LODGroup} Lod Count";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}