Terrain Preserve Tree Prototype Layers#
Miscellaneous / Terrain / Terrain Preserve Tree Prototype Layers
Can Read
Can Write
Description#
The Preserve Tree Prototype Layers property of the Terrain 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]
[Set]
[Title("Terrain Preserve Tree Prototype Layers")]
[Category("Miscellaneous/Terrain/Preserve Tree Prototype Layers")]
[Description("The Preserve Tree Prototype Layers property of the Terrain component")]
[Image(typeof(IconTerrain), ColorTheme.Type.Lime)]
[Serializable]
public class GenTypeBool_Terrain_PreserveTreePrototypeLayers : TypeBool
{
[SerializeField] private GetGameObject m_Terrain = new GetGameObject(
new GenTypeGameObject_Terrain()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_Terrain.GetPreview(source);
if (instance == null) return default;
Terrain component = instance.GetComponent<Terrain>();
return component != null ? component.preserveTreePrototypeLayers : default;
}
public override bool Get(Args args)
{
Terrain instance = this.m_Terrain.Get<Terrain>(args);
return instance != null
? instance.preserveTreePrototypeLayers
: default;
}
public override void Set(bool value, Args args)
{
Terrain component = this.m_Terrain.Get<Terrain>(args);
if (component != null) component.preserveTreePrototypeLayers = (bool) value;
}
public override string ToString()
{
return $"{this.m_Terrain} Preserve Tree Prototype Layers";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}