LOD Group Force LOD#
Rendering / LOD Group / LOD Group Force LOD
Description#
Executes the Force LOD method on the LOD Group component
Parameters#
| Name | Description |
|---|---|
| Index |
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
{
[Title("LOD Group Force LOD")]
[Category("Rendering/LOD Group/Force LOD")]
[Description("Executes the Force LOD method on the LOD Group component")]
[Image(typeof(IconLOD), ColorTheme.Type.Blue)]
[Parameter("Index")]
[Serializable]
public class GenInstructionLODGroup_ForceLOD_1 : Instruction
{
[SerializeField] private GetGameObject m_LODGroup = new GetGameObject(
new GenTypeGameObject_LODGroup()
);
[SerializeField] private GetInteger m_Index = new GetInteger();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Force LOD");
return $"{this.m_LODGroup} {method} ({this.m_Index})";
}
protected override Awaitable Run(Args args)
{
LODGroup component = this.m_LODGroup.Get<LODGroup>(args);
if (component == null) return Done;
component.ForceLOD(
(int) this.m_Index.Get(args)
);
return Done;
}
}
}