using System.Collections.Generic; using UnityEngine.Advertisements.Utilities; namespace UnityEngine.Advertisements { sealed class Configuration { public bool enabled { get; } public string defaultPlacement { get; } public Dictionary placements { get; } public Configuration(string configurationResponse) { var configurationJson = (Dictionary)Json.Deserialize(configurationResponse); enabled = (bool)configurationJson["enabled"]; placements = new Dictionary(); foreach (Dictionary placement in (List)configurationJson["placements"]) { var id = (string)placement["id"]; var allowSkip = (bool)placement["allowSkip"]; if ((bool)placement["default"]) { defaultPlacement = id; } placements.Add(id, allowSkip); } } } }