using System.Collections.Generic;
namespace UnityEngine.Monetization
{
///
/// Class for sending various metadata to UnityAds.
///
public sealed class MetaData : Dictionary
{
///
/// Metadata category.
///
public string category { get; }
///
/// Constructs an metadata instance that can be passed to the Advertisement class.
///
public MetaData(string category)
{
this.category = category;
}
///
/// Sets new metadata fields.
///
/// Metadata key.
/// Metadata value. Must be JSON serializable.
public void Set(string key, object value)
{
this[key] = value;
}
///
/// Returns the stored metadata key.
///
public object Get(string key)
{
return this[key];
}
internal string ToJSON()
{
return MiniJSON.Json.Serialize(this);
}
}
}