Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Terrain Top Neighbor#

Miscellaneous / Terrain / Terrain Top Neighbor

  • Can Read

  • Cannot Write

Description#

The Top Neighbor 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 Top Neighbor")]
    [Category("Miscellaneous/Terrain/Top Neighbor")]
    [Description("The Top Neighbor property of the Terrain component")]
    
    [Image(typeof(IconTerrain), ColorTheme.Type.Lime)]
    
    [Serializable]
    public class GenTypeGameObject_Terrain_TopNeighbor : TypeGameObject
    {
        [SerializeField] private GetGameObject m_Terrain = new GetGameObject(
            new GenTypeGameObject_Terrain()
        );
        
        public override GameObject GetPreview(GameObject source)
        {
            GameObject instance = this.m_Terrain.GetPreview(source);
            if (instance == null) return default;
            
            Terrain component = instance.GetComponent<Terrain>();
            return component != null ? component.topNeighbor.gameObject : default;
        }
        
        public override GameObject Get(Args args)
        {
            Terrain instance = this.m_Terrain.Get<Terrain>(args);
            return instance != null
                ? instance.topNeighbor.gameObject
                : default;
        }
        
        public override U Get<U>(Args args)
        {
            if (typeof(U) == typeof(Terrain))
            {
                Terrain instance = this.m_Terrain.Get<Terrain>(args);
                return instance != null
                    ? instance.topNeighbor as U
                    : default;
            }
            
            return base.Get<U>(args);
        }
        
        public override string ToString()
        {
            return $"{this.m_Terrain} Top Neighbor";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}

Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.