Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class BrushUserToolState<TBrushTarget>

    Inheritance
    object
    SmState
    UserToolStateBase
    BrushUserToolState<TBrushTarget>
    BrushUserToolState<TBrushTarget, TSettings>
    DeformHeightUserToolState<TBrushTarget>
    Implements
    ISmState
    Inherited Members
    UserToolStateBase.Settings
    UserToolStateBase.IsSubstatesVisible
    UserToolStateBase.SubStateMachine
    UserToolStateBase.UserToolType
    UserToolStateBase.UserToolAPI
    UserToolStateBase.HasSubtools
    UserToolStateBase.IsChangeViewMode
    UserToolStateBase.RequiredViewMode
    UserToolStateBase.OriginalViewMode
    UserToolStateBase.ShowSettingsScreen<TViewData, TScreen>(TViewData)
    UserToolStateBase.GetUIScreen<TScreen>()
    UserToolStateBase.HideSettingsScreen<TScreen>()
    UserToolStateBase.SetupPlanetCursor(bool, int)
    UserToolStateBase.SetupPlanetCursor(bool, int, Color32)
    UserToolStateBase.SetupPlanetCursor(bool, int, Color32, bool)
    UserToolStateBase.SetupPlanetCursor(bool)
    UserToolStateBase.TrySetViewMode()
    UserToolStateBase.TryRestoreViewMode()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Fwt.HexTerrains.TerrainEditors.StateMachines
    Assembly: fwt.hexterrains.dll
    Syntax
    public abstract class BrushUserToolState<TBrushTarget> : UserToolStateBase, ISmState where TBrushTarget : class
    Type Parameters
    Name Description
    TBrushTarget

    Constructors

    BrushUserToolState(IHexTerrainAPI)

    Declaration
    public BrushUserToolState(IHexTerrainAPI userToolAPI)
    Parameters
    Type Name Description
    IHexTerrainAPI userToolAPI

    Fields

    AllowRightMouseButton

    Declaration
    [Tooltip("If true, applies brush by right mouse click")]
    public bool AllowRightMouseButton
    Field Value
    Type Description
    bool

    CanChangeBrushSize

    Declaration
    [Tooltip("If true, the brush size can be increased/decreased")]
    public bool CanChangeBrushSize
    Field Value
    Type Description
    bool

    ChangeOpacityMultiplier

    Declaration
    public float ChangeOpacityMultiplier
    Field Value
    Type Description
    float

    PrevChangeTimeStamp

    Used to prevent applying brush too fast (next change will be applied at least after this amount of seconds after previous change)

    Declaration
    [NonSerialized]
    public float PrevChangeTimeStamp
    Field Value
    Type Description
    float

    TimeTreshold

    Declaration
    [Tooltip("Next change to terrain will be applied not sooner then this time after previous change")]
    public float TimeTreshold
    Field Value
    Type Description
    float

    Properties

    BrushOpacity

    Declaration
    public float BrushOpacity { get; }
    Property Value
    Type Description
    float

    BrushSize

    Declaration
    public int BrushSize { get; }
    Property Value
    Type Description
    int

    ChangeBrushSizeKey

    Declaration
    public virtual KeyCode ChangeBrushSizeKey { get; set; }
    Property Value
    Type Description
    KeyCode

    ChangeModeKey

    Declaration
    [Tooltip("When this key is pressed, the brush mode will be 1 instead of default 0")]
    public virtual KeyCode ChangeModeKey { get; set; }
    Property Value
    Type Description
    KeyCode

    ChangeOpacityKey

    Declaration
    [Tooltip("While this key pressed switches from changing size to changing opacity")]
    public virtual KeyCode ChangeOpacityKey { get; set; }
    Property Value
    Type Description
    KeyCode

    CursorColor

    Declaration
    public virtual Color32 CursorColor { get; set; }
    Property Value
    Type Description
    Color32

    DecreaseBrushSizeKey

    Declaration
    [Tooltip("This key decreases brush size/opacity")]
    public virtual KeyCode DecreaseBrushSizeKey { get; set; }
    Property Value
    Type Description
    KeyCode

    DecreaseBrushSizeKey2

    Declaration
    [Tooltip("This key decreases brush size/opacity")]
    public virtual KeyCode DecreaseBrushSizeKey2 { get; set; }
    Property Value
    Type Description
    KeyCode

    IncreaseBrushSizeKey

    Declaration
    [Tooltip("This key increases brush size/opacity")]
    public virtual KeyCode IncreaseBrushSizeKey { get; set; }
    Property Value
    Type Description
    KeyCode

    IncreaseBrushSizeKey2

    Declaration
    [Tooltip("This key increases brush size/opacity")]
    public virtual KeyCode IncreaseBrushSizeKey2 { get; set; }
    Property Value
    Type Description
    KeyCode

    IsTimeTresholdPassed

    True if Time Treshold is already passed after previous change has been applied. True means we can apply next brush change

    Declaration
    public bool IsTimeTresholdPassed { get; }
    Property Value
    Type Description
    bool

    Methods

    ApplyBrush(int, int2, int, TBrushTarget, int)

    Applies brush to the brushView. Returns true if changes were applied

    Declaration
    public abstract bool ApplyBrush(int brushMode, int2 cellCoord, int cellIndex, TBrushTarget brushTarget, int mouseButton)
    Parameters
    Type Name Description
    int brushMode
    int2 cellCoord
    int cellIndex
    TBrushTarget brushTarget
    int mouseButton
    Returns
    Type Description
    bool

    ApplyBrushToAllBrushPoints(int, int2, int, HexTerrainSettings, TBrushTarget, int)

    Declaration
    protected virtual bool ApplyBrushToAllBrushPoints(int brushMode, int2 centerCellCoord, int centerCellIndex, HexTerrainSettings terrainSettings, TBrushTarget brushTarget, int mouseButton)
    Parameters
    Type Name Description
    int brushMode
    int2 centerCellCoord
    int centerCellIndex
    HexTerrainSettings terrainSettings
    TBrushTarget brushTarget
    int mouseButton
    Returns
    Type Description
    bool

    ApplyBrushToAllCells(int, HexTerrainSettings, TBrushTarget, int)

    Declaration
    protected virtual bool ApplyBrushToAllCells(int brushMode, HexTerrainSettings settings, TBrushTarget brushTarget, int mouseButton)
    Parameters
    Type Name Description
    int brushMode
    HexTerrainSettings settings
    TBrushTarget brushTarget
    int mouseButton
    Returns
    Type Description
    bool

    ApplyToSingleCell(int, int2, int, TBrushTarget, int)

    Declaration
    protected virtual bool ApplyToSingleCell(int brushMode, int2 cellCoord, int cellIndex, TBrushTarget brushTarget, int mouseButton)
    Parameters
    Type Name Description
    int brushMode
    int2 cellCoord
    int cellIndex
    TBrushTarget brushTarget
    int mouseButton
    Returns
    Type Description
    bool

    CanBeAppliedToManyPoints(int)

    Declaration
    public virtual bool CanBeAppliedToManyPoints(int brushMode)
    Parameters
    Type Name Description
    int brushMode
    Returns
    Type Description
    bool

    GetBrushTarget()

    Declaration
    public virtual TBrushTarget GetBrushTarget()
    Returns
    Type Description
    TBrushTarget

    IsAppliedToEveryCellOnMap(int)

    Declaration
    public virtual bool IsAppliedToEveryCellOnMap(int brushMode)
    Parameters
    Type Name Description
    int brushMode
    Returns
    Type Description
    bool

    PrepareToRun()

    Declaration
    public override void PrepareToRun()
    Overrides
    UserToolStateBase.PrepareToRun()

    PrepareToStop()

    Declaration
    public override void PrepareToStop()
    Overrides
    UserToolStateBase.PrepareToStop()

    SetNewTimestamp()

    Saves current unscaled time as a new PrevChangeTimeStamp, which allows to prevent applying brush too often (see TimeTreshold)

    Declaration
    public void SetNewTimestamp()

    Tick()

    Declaration
    public override void Tick()
    Overrides
    UserToolStateBase.Tick()

    TryApplyBrush()

    Declaration
    protected virtual void TryApplyBrush()

    UpdateBrush()

    Declaration
    protected virtual void UpdateBrush()

    Implements

    ISmState

    Extension Methods

    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    In this article
    Back to top Generated by DocFX