Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ResourceAssetEntry

Represents a localized asset stored as a path into a Resources folder.
Read time 1 minuteLast updated 8 days ago

Definition

public class ResourceAssetEntry : AssetEntryBase<string>, IAssetEntry, ISynchronousAssetEntry, IFileDataEntry, IResourceEntry

Remarks

The entry keeps only the
Resources
path in AssetEntryBase<TStore>.Default, and the asset ships through its Resources folder rather than as a direct reference, so nothing extra is packed with the table. The asset is resolved on demand with
Resources.Load
and unloaded by ReleaseAsset. Use AssetEntry instead when you want a direct reference packed with the table.
Add a Resources-backed asset entry and confirm it has a path.

Examples

using Unity.Localization;using UnityEngine;namespace Unity.Localization.Samples{ public class ResourceAssetEntryOverviewExample { public void Run() { var shared = ScriptableObject.CreateInstance<SharedTableData>(); shared.TableCollectionName = "UI Assets"; var table = ScriptableObject.CreateInstance<ResourceTable>(); table.SharedData = shared; table.LocaleIdentifier = new LocaleIdentifier("en"); var entry = new ResourceAssetEntry(shared.AddKey("music").Id); entry.Default = "Audio/theme"; // a path under a Resources folder table.AddEntry(entry); Debug.Log(entry.HasAsset()); // True: a path is set } }}

Constructors

Constructor

Description

ResourceAssetEntry()Creates an empty entry.
ResourceAssetEntry(System.Int64)Creates an entry for a key id.

Inheritance