Class AssetReference
Asset reference.
Namespace: UnityEngine.AssetGraph
Syntax
[Serializable]
public class AssetReference
Properties
absolutePath
Gets the absolute path.
Declaration
public string absolutePath { get; }
Property Value
Type | Description |
---|---|
String | The absolute path. |
allData
Gets all data.
Declaration
public Object[] allData { get; }
Property Value
Type | Description |
---|---|
UnityEngine.Object[] | All data. |
assetDatabaseId
Gets the asset database identifier.
Declaration
public string assetDatabaseId { get; }
Property Value
Type | Description |
---|---|
String | The asset database identifier. |
assetType
Gets main asset type.
Declaration
public Type assetType { get; }
Property Value
Type | Description |
---|---|
Type | The type of the asset. |
exportTo
Gets or sets the export to.
Declaration
public string exportTo { get; set; }
Property Value
Type | Description |
---|---|
String | The export to. |
extension
Gets extension.
Declaration
public string extension { get; }
Property Value
Type | Description |
---|---|
String | The extension of the file name. |
fileName
Gets the name of the file.
Declaration
public string fileName { get; }
Property Value
Type | Description |
---|---|
String | The name of the file. |
fileNameAndExtension
Gets the file name and extension.
Declaration
public string fileNameAndExtension { get; }
Property Value
Type | Description |
---|---|
String | The file name and extension. |
filterType
Get type of asset used by filtering. filterType will be variation of AssetImporter if asset has importer, otherwise returns asset type. filterType may be null if this asset should be ignored by loading/filtering (manifest, etc)
Declaration
public Type filterType { get; }
Property Value
Type | Description |
---|---|
Type | The type of the filter. |
id
Gets the identifier.
Declaration
public string id { get; }
Property Value
Type | Description |
---|---|
String | The identifier. |
importerType
Get type of asset importer. Returns null if asset does not have importer.
Declaration
public Type importerType { get; }
Property Value
Type | Description |
---|---|
Type | The type of the filter. |
importFrom
Gets or sets the import from.
Declaration
public string importFrom { get; set; }
Property Value
Type | Description |
---|---|
String | The import from. |
isProjectAsset
Gets a value indicating whether this AssetReference is a reference of asset in this Project. Asset outside of project means this file is outside of Assets/ directory.
Declaration
public bool isProjectAsset { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
isSceneAsset
Gets a value indicating whether this AssetReference is referencing a scene asset.
Declaration
public bool isSceneAsset { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
path
Gets the path.
Declaration
public string path { get; }
Property Value
Type | Description |
---|---|
String | The path. |
runtimeMemorySize
File size (byte)
Declaration
public long runtimeMemorySize { get; }
Property Value
Type | Description |
---|---|
Int64 | File size (byte) |
scene
Gets the scene.
Declaration
public SceneManagement.Scene scene { get; }
Property Value
Type | Description |
---|---|
UnityEngine.SceneManagement.Scene | The loaded Scene object. |
variantName
Gets or sets the name of the variant.
Declaration
public string variantName { get; set; }
Property Value
Type | Description |
---|---|
String | The name of the variant. |
Methods
CreateAssetBundleManifestReference(String)
Creates the asset bundle manifest reference.
Declaration
public static AssetReference CreateAssetBundleManifestReference(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | Path. |
Returns
Type | Description |
---|---|
AssetReference | The asset bundle manifest reference. |
CreateAssetBundleReference(String)
Creates the asset bundle reference.
Declaration
public static AssetReference CreateAssetBundleReference(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | Path. |
Returns
Type | Description |
---|---|
AssetReference | The asset bundle reference. |
CreatePrefabReference(String)
Creates the prefab reference.
Declaration
public static AssetReference CreatePrefabReference(string importFrom)
Parameters
Type | Name | Description |
---|---|---|
String | importFrom | Import from. |
Returns
Type | Description |
---|---|
AssetReference | The prefab reference. |
CreateReference(String)
Creates the reference.
Declaration
public static AssetReference CreateReference(string importFrom)
Parameters
Type | Name | Description |
---|---|---|
String | importFrom | Import from. |
Returns
Type | Description |
---|---|
AssetReference | The reference. |
CreateReference(String, Type)
Creates the reference.
Declaration
public static AssetReference CreateReference(string importFrom, Type assetType)
Parameters
Type | Name | Description |
---|---|---|
String | importFrom | Import from. |
Type | assetType | Asset type. |
Returns
Type | Description |
---|---|
AssetReference | The reference. |
CreateUnityPackageReference(String)
Creates the unity package reference.
Declaration
public static AssetReference CreateUnityPackageReference(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | Path. |
Returns
Type | Description |
---|---|
AssetReference | The unity package reference. |
GetFileSize()
Declaration
public long GetFileSize()
Returns
Type | Description |
---|---|
Int64 |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
InvalidateTypeCache()
Declaration
public void InvalidateTypeCache()
ReleaseData()
Releases the data.
Declaration
public void ReleaseData()
SetDirty()
Sets the dirty.
Declaration
public void SetDirty()
TouchImportAsset()
Touchs the import asset.
Declaration
public void TouchImportAsset()