Firstborn/Library/PackageCache/com.unity.ads@4.4.2/Runtime/Advertisement/Configuration.cs
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

30 lines
1.0 KiB
C#

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