Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class LoadTerrainUserToolStateBase<TScreen, TCallback>

    Inheritance
    object
    SmState
    UserToolStateBase
    HexTerrainUserToolStateBase
    LoadTerrainUserToolStateBase<TScreen, TCallback>
    LoadTerrainUserToolState
    Implements
    ISmState
    Inherited Members
    HexTerrainUserToolStateBase.TerrainAPI
    HexTerrainUserToolStateBase.HexTerrainUserToolSettings
    HexTerrainUserToolStateBase.PreviousViewMode
    HexTerrainUserToolStateBase.Init(HexTerrainUserToolStateSettings)
    HexTerrainUserToolStateBase.Init(IHexTerrainAPI)
    HexTerrainUserToolStateBase.Init<TInitArgs>(TInitArgs)
    HexTerrainUserToolStateBase.Init<TInitArgs>(IHexTerrainAPI, TInitArgs)
    HexTerrainUserToolStateBase.ShowSettingsScreen<TViewData, TScreen>(TViewData)
    HexTerrainUserToolStateBase.GetUIScreen<TScreen>()
    HexTerrainUserToolStateBase.HideSettingsScreen<TScreen>()
    HexTerrainUserToolStateBase.SetupTerrainCursor(bool, int)
    HexTerrainUserToolStateBase.SetupTerrainCursor(bool, int, Color32)
    HexTerrainUserToolStateBase.SetupTerrainCursor(bool, int, Color32, bool)
    HexTerrainUserToolStateBase.SetupTerrainCursor(bool)
    HexTerrainUserToolStateBase.GetTerrainLayer<TLayerGroup, TLayer>(HexTerrainLayerReference)
    HexTerrainUserToolStateBase.TrySetViewMode()
    HexTerrainUserToolStateBase.SetViewMode(SetViewModeRequest)
    HexTerrainUserToolStateBase.TryRestoreViewMode()
    UserToolStateBase.Settings
    UserToolStateBase.Parent
    UserToolStateBase.ParentStateMachine
    UserToolStateBase.Init(UserToolStateSettings)
    UserToolStateBase.Tick()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Fwt.HexTerrains.UserTools.SM.States
    Assembly: fwt.hexterrains.dll
    Syntax
    public abstract class LoadTerrainUserToolStateBase<TScreen, TCallback> : HexTerrainUserToolStateBase, ISmState where TScreen : UIScreen, IViewDataReceiver<TCallback> where TCallback : LoadTerrainCallbackDataSource, new()
    Type Parameters
    Name Description
    TScreen
    TCallback

    Constructors

    LoadTerrainUserToolStateBase(ISmState)

    Declaration
    protected LoadTerrainUserToolStateBase(ISmState parent)
    Parameters
    Type Name Description
    ISmState parent

    Properties

    CallbackDataSource

    Gets or sets the callback data source used to provide custom data or behavior for operations requiring callbacks.

    Declaration
    protected virtual TCallback CallbackDataSource { get; set; }
    Property Value
    Type Description
    TCallback
    Remarks

    Override this property in a derived class to supply a specific callback implementation. The value may be null if no callback is required.

    Screen

    Gets or sets the current screen instance associated with the load terrain user tool.

    Declaration
    protected virtual TScreen Screen { get; set; }
    Property Value
    Type Description
    TScreen

    UserToolType

    Type identifier for the user tool. Allows state machine to change states based on tool type instead of state index.

    Declaration
    public override int UserToolType { get; }
    Property Value
    Type Description
    int
    Overrides
    UserToolStateBase.UserToolType

    Methods

    CancelLoading()

    Cancels the current loading operation and switches the parent state machine to the pointer tool state.

    Declaration
    protected virtual void CancelLoading()
    Remarks

    Override this method to customize the behavior when a loading operation is cancelled. This method is typically called in response to user actions that interrupt or abort loading. If the parent state machine is not set, no state change will occur.

    CreateScreenCallback()

    Creates and initializes a new instance of the screen callback object with default load and cancel handlers.

    Declaration
    protected virtual TCallback CreateScreenCallback()
    Returns
    Type Description
    TCallback

    A new instance of TCallback configured with terrain loading and cancellation callbacks.

    Remarks

    Override this method to customize the initialization of the screen callback or to provide alternative handlers for loading and cancellation.

    GetCallbackDataSource()

    Retrieves the current callback data source, creating it if it does not already exist.

    Declaration
    protected virtual TCallback GetCallbackDataSource()
    Returns
    Type Description
    TCallback

    The callback data source instance of type TCallback. If the data source has not been created, a new instance is initialized and returned.

    Remarks

    This method ensures that the callback data source is initialized before returning it. Derived classes can override this method to customize the initialization or retrieval logic.

    GetUIScreen()

    Retrieves the current UI screen instance of type TScreen. If the screen does not exist, a new instance is created and returned.

    Declaration
    protected virtual TScreen GetUIScreen()
    Returns
    Type Description
    TScreen

    The UI screen instance of type TScreen. If no instance exists, a new one is created and returned.

    Remarks

    Subsequent calls return the same instance unless the screen is reset externally. This method is typically used to ensure a valid UI screen is available for further operations.

    HideUIScreen()

    Hides the associated UI screen if it is currently visible.

    Declaration
    protected virtual void HideUIScreen()
    Remarks

    Override this method to customize the behavior when hiding the UI screen. If the Screen property is null, no action is taken.

    LoadTerrain(string)

    Loads terrain data from the specified file path.

    Declaration
    protected virtual void LoadTerrain(string filePath)
    Parameters
    Type Name Description
    string filePath

    The path to the terrain file to load. Cannot be null or empty.

    Remarks

    After loading the terrain, the parent state machine is switched to the pointer tool state. Override this method to customize terrain loading behavior in derived classes.

    PrepareToRun()

    Performs any necessary initialization or setup required before executing the main operation. Called by state machine once when state becomes active. If state is disabled and then enabled again, this method will be called again.

    Declaration
    public override void PrepareToRun()
    Overrides
    HexTerrainUserToolStateBase.PrepareToRun()
    Remarks

    Override this method to implement preparation logic specific to the derived class. This method should be called prior to running the core functionality to ensure all prerequisites are met.

    PrepareToStop()

    Performs any necessary actions to prepare the object for stopping or shutdown. Called when the state is about to be deactivated.

    Declaration
    public override void PrepareToStop()
    Overrides
    HexTerrainUserToolStateBase.PrepareToStop()
    Remarks

    Implementations should ensure that all resources are released and any ongoing operations are safely terminated before the object is stopped. This method is typically called prior to disposing or shutting down the object to ensure a clean transition.

    ShowUIScreen()

    Displays the associated UI screen and updates its view data using the current callback data source.

    Declaration
    protected virtual void ShowUIScreen()
    Remarks

    Override this method to customize how the UI screen is shown or how its view data is set. If no UI screen is available, the method performs no action.

    Implements

    ISmState

    Extension Methods

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