14 [Tooltip(
"Specifies the maximum allowed ad content rating, based on ESRB classifications.")]
18 [Tooltip(
"Specifies whether ad requests require child, teen, or unspecified age-restricted treatment.")]
47 #region Legacy age treatment migration
49 private const int CurrentSerializationVersion = 1;
50 private const int LegacyTreatmentTrue = 1;
51 private const int MissingLegacyTreatment =
int.MinValue;
53 [SerializeField, HideInInspector]
54 [UnityEngine.Serialization.FormerlySerializedAs(
"TagForChildDirectedTreatment")]
55 private int legacyTagForChildDirectedTreatment = MissingLegacyTreatment;
57 [SerializeField, HideInInspector]
58 [UnityEngine.Serialization.FormerlySerializedAs(
"TagForUnderAgeOfConsent")]
59 private int legacyTagForUnderAgeOfConsent = MissingLegacyTreatment;
61 [SerializeField, HideInInspector]
62 private int serializationVersion = CurrentSerializationVersion;
70 private void MigrateLegacyAgeTreatment()
72 var hasLegacyTreatment = legacyTagForChildDirectedTreatment != MissingLegacyTreatment
73 || legacyTagForUnderAgeOfConsent != MissingLegacyTreatment;
74 if (serializationVersion >= CurrentSerializationVersion && !hasLegacyTreatment)
77 if (hasLegacyTreatment)
81 || legacyTagForUnderAgeOfConsent == LegacyTreatmentTrue
82 ? AgeRestrictedTreatment.Child
86 legacyTagForChildDirectedTreatment = MissingLegacyTreatment;
87 legacyTagForUnderAgeOfConsent = MissingLegacyTreatment;
88 serializationVersion = CurrentSerializationVersion;