Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Configuration.cs 1.0KB

1234567891011121314151617181920212223242526272829
  1. using System.Collections.Generic;
  2. using UnityEngine.Advertisements.Utilities;
  3. namespace UnityEngine.Advertisements
  4. {
  5. sealed class Configuration
  6. {
  7. public bool enabled { get; }
  8. public string defaultPlacement { get; }
  9. public Dictionary<string, bool> placements { get; }
  10. public Configuration(string configurationResponse)
  11. {
  12. var configurationJson = (Dictionary<string, object>)Json.Deserialize(configurationResponse);
  13. enabled = (bool)configurationJson["enabled"];
  14. placements = new Dictionary<string, bool>();
  15. foreach (Dictionary<string, object> placement in (List<object>)configurationJson["placements"])
  16. {
  17. var id = (string)placement["id"];
  18. var allowSkip = (bool)placement["allowSkip"];
  19. if ((bool)placement["default"])
  20. {
  21. defaultPlacement = id;
  22. }
  23. placements.Add(id, allowSkip);
  24. }
  25. }
  26. }
  27. }