using UnityEngine; namespace UnityEditor.TerrainTools { /// /// An interface that represents a terrain paint tool. /// public interface ITerrainToolPaintTool { /// /// Gets whether the paint tool supports brush filters. /// bool HasBrushFilters => false; } /// /// Base class for terrain paint tools that provides common functionality and brush UI support. /// /// The specific type of terrain paint tool implementing this class. public abstract class TerrainToolsPaintTool : TerrainPaintToolWithOverlays, ITerrainToolPaintTool where T : TerrainToolsPaintTool { /// /// The common brush UI group associated with this paint tool. /// public IBrushUIGroup m_commonUI { get; protected set; } /// /// Gets whether the paint tool supports brush filters. /// public virtual bool HasBrushFilters => false; /// /// Protected constructor for terrain paint tools. /// protected TerrainToolsPaintTool() { } private static T s_instance; /// /// Gets the instance of the terrain paint tool. /// public static T instance { get { if (s_instance == null) { s_instance = ScriptableObject.CreateInstance(); } return s_instance; } } } /// /// Enumeration of brush overlay GUI flags that determine which brush controls are displayed. /// [System.Flags] public enum BrushOverlaysGUIFlags { /// /// No brush overlays. /// None = 0, /// /// Show filter overlay. /// Filter = 1, /// /// Show strength overlay. /// Strength = 2, /// /// Show size overlay. /// Size = 4, /// /// Show rotation overlay. /// Rotation = 8, /// /// Show spacing overlay. /// Spacing = 16, /// /// Show scatter overlay. /// Scatter = 32, /// /// Show all brush overlays. /// All = Filter | Strength | Size | Rotation | Spacing | Scatter, } }