Table of Contents

Class DrawToolSettings

ScriptableObject that holds all drawing tool settings. This is the single source of truth for brush, color, and canvas settings.

public class DrawToolSettings : ScriptableObject
Inheritance
DrawToolSettings

Properties

BrushAntiAlias

public bool BrushAntiAlias { get; set; }

Property Value

bool

BrushHardness

public float BrushHardness { get; set; }

Property Value

float

BrushJitter

public float BrushJitter { get; set; }

Property Value

float

BrushName

public string BrushName { get; set; }

Property Value

string

BrushOpacity

public float BrushOpacity { get; set; }

Property Value

float

BrushPresets

public List<DrawToolSettings.BrushPreset> BrushPresets { get; }

Property Value

List<DrawToolSettings.BrushPreset>

BrushScatter

public float BrushScatter { get; set; }

Property Value

float

BrushSize

public int BrushSize { get; set; }

Property Value

int

BrushSpacing

public float BrushSpacing { get; set; }

Property Value

float

BrushType

public Brush.BrushType BrushType { get; set; }

Property Value

Brush.BrushType

CurrentTool

public DrawToolSettings.DrawingTool CurrentTool { get; set; }

Property Value

DrawToolSettings.DrawingTool

DefaultBackgroundColor

public Color DefaultBackgroundColor { get; set; }

Property Value

Color

DefaultCanvasHeight

public int DefaultCanvasHeight { get; set; }

Property Value

int

DefaultCanvasWidth

public int DefaultCanvasWidth { get; set; }

Property Value

int

MinPressureOpacity

public float MinPressureOpacity { get; set; }

Property Value

float

MinPressureSize

public float MinPressureSize { get; set; }

Property Value

float

PrimaryColor

public Color PrimaryColor { get; set; }

Property Value

Color

SecondaryColor

public Color SecondaryColor { get; set; }

Property Value

Color

UsePressureForOpacity

public bool UsePressureForOpacity { get; set; }

Property Value

bool

UsePressureForSize

public bool UsePressureForSize { get; set; }

Property Value

bool

Methods

ApplyBrush(Brush)

Apply settings from a Brush object.

public void ApplyBrush(Brush brush)

Parameters

brush Brush

ApplyPreset(BrushPreset)

Apply a brush preset to current settings.

public void ApplyPreset(DrawToolSettings.BrushPreset preset)

Parameters

preset DrawToolSettings.BrushPreset

CreateBrush()

Create a Brush object from current settings.

public Brush CreateBrush()

Returns

Brush

CreateDefaultPresets()

Create default presets.

public void CreateDefaultPresets()

GetEffectiveOpacity(float)

Get effective opacity based on pressure.

public float GetEffectiveOpacity(float pressure)

Parameters

pressure float

Returns

float

GetEffectiveSize(float)

Get effective brush size based on pressure.

public int GetEffectiveSize(float pressure)

Parameters

pressure float

Returns

int

ResetToDefaults()

Reset to default settings.

public void ResetToDefaults()

SwapColors()

Swap primary and secondary colors.

public void SwapColors()

Events

OnBrushHardnessChanged

public event Action<float> OnBrushHardnessChanged

Event Type

Action<float>

OnBrushOpacityChanged

public event Action<float> OnBrushOpacityChanged

Event Type

Action<float>

OnBrushSizeChanged

public event Action<int> OnBrushSizeChanged

Event Type

Action<int>

OnBrushTypeChanged

public event Action<Brush.BrushType> OnBrushTypeChanged

Event Type

Action<Brush.BrushType>

OnPrimaryColorChanged

public event Action<Color> OnPrimaryColorChanged

Event Type

Action<Color>

OnSecondaryColorChanged

public event Action<Color> OnSecondaryColorChanged

Event Type

Action<Color>

OnSettingsChanged

public event Action OnSettingsChanged

Event Type

Action

OnToolChanged

public event Action<DrawToolSettings.DrawingTool> OnToolChanged

Event Type

Action<DrawToolSettings.DrawingTool>