Search Results for

    Show / Hide Table of Contents

    Class AssetReferenceBase

    Asset reference utility. Keeps reference to the linked asset object and handles load/unload events.

    Inheritance
    IAssetReference
    AssetReferenceBase
    Inherited Members
    IAssetReference::~IAssetReference()
    Assembly: FlaxEngine.dll
    File: Engine/Content/AssetReference.h
    Syntax
    public class AssetReferenceBase : public IAssetReference

    Constructors

    ~AssetReferenceBase()

    Finalizes an instance of the AssetReferenceBase class.

    Declaration
    public ~AssetReferenceBase()

    AssetReferenceBase()

    Initializes a new instance of the AssetReferenceBase class.

    Declaration
    public AssetReferenceBase() = default

    AssetReferenceBase(IAssetReference* owner)

    Initializes a new instance of the AssetReferenceBase class.

    Declaration
    public AssetReferenceBase(IAssetReference* owner)
    Parameters
    IAssetReference owner

    The reference owner to keep notified about asset changes.

    Fields

    _asset

    Declaration
    protected Asset* _asset = nullptr
    Field Value
    Asset

    _owner

    Declaration
    protected IAssetReference* _owner = nullptr
    Field Value
    IAssetReference

    Changed

    Action fired when field gets changed (link a new asset or change to the another value).

    Declaration
    public Action Changed
    Field Value
    Action

    Loaded

    The asset loaded event (fired when asset gets loaded or is already loaded after change).

    Declaration
    public Action Loaded
    Field Value
    Action

    Unload

    The asset unloading event (should cleanup refs to it).

    Declaration
    public Action Unload
    Field Value
    Action

    Methods

    GetID()

    Gets the asset ID or Guid::Empty if not set.

    Declaration
    public Guid GetID() const
    Returns
    Guid

    GetManagedInstance()

    Gets managed instance object (or null if no asset set).

    Declaration
    public MObject* GetManagedInstance() const
    Returns
    MObject

    OnAssetChanged(Asset* asset, void* caller)

    Declaration
    public virtual void OnAssetChanged(Asset* asset, void* caller) override
    Parameters
    Asset asset

    void caller

    Overrides
    IAssetReference::OnAssetChanged(Asset* asset, void* caller)

    OnAssetLoaded(Asset* asset, void* caller)

    Declaration
    public virtual void OnAssetLoaded(Asset* asset, void* caller) override
    Parameters
    Asset asset

    void caller

    Overrides
    IAssetReference::OnAssetLoaded(Asset* asset, void* caller)

    OnAssetUnloaded(Asset* asset, void* caller)

    Declaration
    public virtual void OnAssetUnloaded(Asset* asset, void* caller) override
    Parameters
    Asset asset

    void caller

    Overrides
    IAssetReference::OnAssetUnloaded(Asset* asset, void* caller)

    OnSet(Asset* asset)

    Declaration
    protected void OnSet(Asset* asset)
    Parameters
    Asset asset

    ToString()

    Gets the asset property value as string.

    Declaration
    public String ToString() const
    Returns
    String

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat