Interface IReadOnlyProductCache
Read only access to a product cache.
Namespace: UnityEngine.Purchasing.Extension
Assembly: Unity.Purchasing.dll
Syntax
public interface IReadOnlyProductCache
Methods
Find(string?)
Gets a product by its product ID.
Declaration
Product? Find(string? productId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | productId | Product ID to query by. |
Returns
| Type | Description |
|---|---|
| Product | The matching product if found, otherwise returns null. |
FindOrDefault(string?)
Find a matching product by its ID.
Declaration
Product FindOrDefault(string? productId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | productId | Product ID to query by. |
Returns
| Type | Description |
|---|---|
| Product | The matching product if found, otherwise returns an Unknown Product. |
GetProducts()
Get all products currently in the cache.
Declaration
ReadOnlyObservableCollection<Product> GetProducts()
Returns
| Type | Description |
|---|---|
| ReadOnlyObservableCollection<Product> |