csharp
public sealed class TerrainPaintCommandOne paint stroke as one entry in the undo history.
Remarks
The sibling of TerrainStrokeCommand, over a different record. A sculpt stroke holds one layer's deltas; a paint stroke holds every layer's weights, because painting one lowers the rest proportionally — see TerrainWeightStroke.
⚠ Merging is off, for [§ D11]'s reason. Two strokes are two undos. What merges is inside the stroke: a drag is one record being extended, so by the time one of these exists the merging has already happened.
Fields and properties (4)
public string NameWhat this is called in the undo history, as a person would say it.
public TerrainRect RectWhich samples the stroke touched.
public int RecordedSamplesHow many samples the record holds.
public long BytesHow many bytes it occupies.
Methods (4)
public TerrainPaintCommand(Terrain terrain, TerrainWeightStroke stroke, string name, Action<TerrainRect>? changed = null)Records an applied paint stroke.
public void Do(EditorContext context)Applies the change.
public void Undo(EditorContext context)Puts back exactly what Do changed.
public bool TryMergeWith(IEditorCommand previous, out IEditorCommand? merged)
Used by (2)
- TerrainEditVixen.Editor.Terrain
- TerrainPaintModeTestsVixen.Editor.Terrain.Tests