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