docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EditorAssetLoading

    An asset loading wrapper provided to each nodes of a graph during an import at editor time.

    Inheritance
    object
    AssetLoading
    EditorAssetLoading
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.Importer
    Assembly: Unity.Importer.Editor.dll
    Syntax
    public sealed class EditorAssetLoading : AssetLoading

    Constructors

    EditorAssetLoading(AssetImportContext)

    An asset loading wrapper provided to each nodes of a graph during an import at editor time.

    Declaration
    public EditorAssetLoading(AssetImportContext assetImportContext)
    Parameters
    Type Name Description
    AssetImportContext assetImportContext

    The AssetImportContext of the current import (provided by a ScriptedImporter).

    Properties

    AssetPath

    The path of the imported file.

    Declaration
    public override string AssetPath { get; }
    Property Value
    Type Description
    string
    Overrides
    AssetLoading.AssetPath

    Methods

    DependsOnSourceAsset(string)

    Declares a dependency to an other file in the project.

    Declaration
    public override void DependsOnSourceAsset(string filePath)
    Parameters
    Type Name Description
    string filePath

    The path of the file to depends on. It can be a path in the Assets folder or any Package.

    Overrides
    AssetLoading.DependsOnSourceAsset(string)
    Remarks

    Changing, removing, or adding a file at that path in the project will re-import the asset declaring that dependency. AssetImportContext.

    GetAssetAtPath<T>(string)

    Loads another asset at the given path and adds a dependency to the loaded artifact.

    Declaration
    public override T GetAssetAtPath<T>(string filePath) where T : Object
    Parameters
    Type Name Description
    string filePath

    The path of the file generating the artifacts to depend on. It can be a path in the Assets folder or any Package.

    Returns
    Type Description
    T

    The Asset instance at the given filePath.

    Type Parameters
    Name Description
    T

    The type of asset to load.

    Overrides
    AssetLoading.GetAssetAtPath<T>(string)
    Remarks

    If the imported artifact at the given path is changed, this will re-import the asset loading it. AssetImportContext.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)