Class AssetProductReference
Class AssetProductReference.
Namespace: Unity.Industrial.Forma.Core.AddressableSources
Syntax
[Serializable]
[MovedFrom(true, "UnityEngine.Industrial.Configuring.Core", "Unity.Industrial.Configurator", null)]
public class AssetProductReference
Constructors
AssetProductReference(AssetReferenceGameObject, AssetProductReference.Options)
Initializes a new instance of the AssetProductReference class.
Declaration
public AssetProductReference(AssetReferenceGameObject assetReference, AssetProductReference.Options options = AssetProductReference.Options.Destroyable | AssetProductReference.Options.Deactiveable | AssetProductReference.Options.UseSpawnPoint | AssetProductReference.Options.UseProductCache)
Parameters
Type | Name | Description |
---|---|---|
AssetReferenceGameObject | assetReference | The asset reference. |
AssetProductReference.Options | options | Product options. |
Fields
key
Contains an editorAsset GUID or a Catalog address if 'CatalogProductReference'.
Declaration
[SerializeField]
public string key
Field Value
Type | Description |
---|---|
String |
m_IsInitialized
Check if the reference was set using a valid asset.
Declaration
[SerializeField]
protected bool m_IsInitialized
Field Value
Type | Description |
---|---|
Boolean |
Properties
AssetReference
Gets or sets the asset reference.
Declaration
public AssetReferenceGameObject AssetReference { get; set; }
Property Value
Type | Description |
---|---|
AssetReferenceGameObject | The asset reference. |
Deactiveable
If not destroyed, deactivate the product gameObject after unload.
Default: True
Declaration
public bool Deactiveable { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Destroyable
Destroy the product gameObject after unload.
If True, ReleaseAsset() will be called.
Default: True
Declaration
public bool Destroyable { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
FriendlyName
Gets or sets the name of the friendly.
Declaration
public virtual string FriendlyName { get; set; }
Property Value
Type | Description |
---|---|
String | The name of the friendly. |
Product
Gets the product.
Declaration
public Product Product { get; }
Property Value
Type | Description |
---|---|
Product | The product. |
ProductOptions
Product options.
Declaration
public AssetProductReference.Options ProductOptions { get; set; }
Property Value
Type | Description |
---|---|
AssetProductReference.Options |
UseProductCache
If not destroyed and ProductRepository cache is Enabled, the product gameObject will be cached.
Default: True
Declaration
public bool UseProductCache { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
UseSpawnPoint
The product gameObject will be moved and placed under the spawn point.
Default: True
Declaration
public bool UseSpawnPoint { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
IsProduct(Product)
Determines whether the specified other is product.
Declaration
public bool IsProduct(Product other)
Parameters
Type | Name | Description |
---|---|---|
Product | other | The other. |
Returns
Type | Description |
---|---|
Boolean |
|
IsValid()
Returns true if ... is valid.
Declaration
public virtual bool IsValid()
Returns
Type | Description |
---|---|
Boolean |
|
LoadAssetAsync<TObject>()
Loads the asset asynchronous.
Declaration
public virtual AsyncOperationHandle<TObject> LoadAssetAsync<TObject>()
Returns
Type | Description |
---|---|
AsyncOperationHandle<TObject> | AsyncOperationHandle<TObject>. |
Type Parameters
Name | Description |
---|---|
TObject | The type of the t object. |
ReleaseAsset()
Releases the asset.
Declaration
public virtual void ReleaseAsset()
SetAssetReference(AssetReferenceGameObject, AssetProductReference.Options)
Sets the asset reference.
Note: Using SetAsset() here will setup everything accordingly based on the new asset including the key, FriendlyName and Options.
Declaration
public void SetAssetReference(AssetReferenceGameObject assetReference, AssetProductReference.Options options = AssetProductReference.Options.Destroyable | AssetProductReference.Options.Deactiveable | AssetProductReference.Options.UseSpawnPoint | AssetProductReference.Options.UseProductCache)
Parameters
Type | Name | Description |
---|---|---|
AssetReferenceGameObject | assetReference | The asset reference. |
AssetProductReference.Options | options | Product options. |
SupportsAddressableLoadMode(Addressable.LoadMode)
Check if the reference supports the current addressable load mode.
Declaration
public virtual bool SupportsAddressableLoadMode(Addressable.LoadMode loadMode)
Parameters
Type | Name | Description |
---|---|---|
Addressable.LoadMode | loadMode | Supported load mode. |
Returns
Type | Description |
---|---|
Boolean |
|