using System.Text; using UnityEngine; using UnityEngine.TerrainTools; namespace UnityEditor.TerrainTools { /// /// An interface that represents a brush's controller. /// /// This interface is used for implementing custom controllers for handling brush properties. /// /// /// /// /// /// /// public interface IBrushController { /// /// Determines if the brush controller is in use. /// bool isInUse { get; } /// /// Defines data when the brush is selected. /// /// The shortcut handler used to add and refernce shortcuts. void OnEnterToolMode(BrushShortcutHandler shortcutHandler); /// /// Defines data when the brush is deselected. /// /// The shortcut handler used to add and refernce shortcuts. void OnExitToolMode(BrushShortcutHandler shortcutHandler); /// /// Triggers events to render objects and displays within Scene view. /// /// The event state within the OnSceneGUI call. /// The control identification of the OnSceneGUI /// The terrain in focus. /// The editcontext to reference. void OnSceneGUI(Event currentEvent, int controlId, Terrain terrain, IOnSceneGUI editContext); /// /// Triggers events to render objects and displays within Scene view. /// /// The terrain in focus. /// The editcontext to reference. void OnInspectorGUI(Terrain terrain, IOnInspectorGUI editContext); /// /// Triggers events when painting on a terrain. /// /// The in focus. /// The editcontext to reference. /// Returns true if the paint operation is succesful. Otherwise, returns false. bool OnPaint(Terrain terrain, IOnPaint editContext); /// /// Adds basic information to the selected brush. /// /// The in focus. /// The to reference. /// The containing the brush information. void AppendBrushInfo(Terrain terrain, IOnSceneGUI editContext, StringBuilder builder); } }