lib_unity_purchase/Runtime/Stores/BaseStore/MetricizedJsonStore.cs

30 lines
999 B
C#
Raw Permalink Normal View History

2024-01-29 18:49:33 +08:00
using System.Collections.ObjectModel;
using UnityEngine.Purchasing.Telemetry;
namespace UnityEngine.Purchasing
{
class MetricizedJsonStore : JSONStore
{
readonly ITelemetryMetricsService m_TelemetryMetricsService;
public MetricizedJsonStore(ITelemetryMetricsService telemetryMetricsService)
{
m_TelemetryMetricsService = telemetryMetricsService;
}
public override void RetrieveProducts(ReadOnlyCollection<ProductDefinition> products)
{
m_TelemetryMetricsService.ExecuteTimedAction(
() => base.RetrieveProducts(products),
TelemetryMetricDefinitions.retrieveProductsName);
}
public override void Purchase(ProductDefinition product, string developerPayload)
{
m_TelemetryMetricsService.ExecuteTimedAction(
() => base.Purchase(product, developerPayload),
TelemetryMetricDefinitions.initPurchaseName);
}
}
}