#if UNITY_EDITOR using System.Collections.Generic; namespace UnityEngine.Monetization { sealed class Configuration { public bool enabled { get; private set; } public string defaultPlacement { get; private set; } public Dictionary placementContents { get; private set; } public Configuration(string configurationResponse) { var configurationJson = (Dictionary)MiniJSON.Json.Deserialize(configurationResponse); enabled = (bool)configurationJson["enabled"]; placementContents = 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; } foreach (object type in (List)placement["adTypes"]) { if ((string)type == "IAP") { EditorPromoAdOperations operations = new EditorPromoAdOperations(); operations.allowSkip = allowSkip; operations.placementId = id; PromoAdPlacementContent placementContent = new PromoAdPlacementContent(id, operations); placementContents.Add(id, placementContent); placementContent.extras = new Dictionary {}; break; } if ((string)type == "VIDEO") { EditorShowAdOperations operations = new EditorShowAdOperations(); operations.allowSkip = allowSkip; operations.placementId = id; ShowAdPlacementContent placementContent = new ShowAdPlacementContent(id, operations); placementContents.Add(id, placementContent); placementContent.extras = new Dictionary {}; break; } } } } } } #endif