Space Ad Mobile 9.5.1
Space Ad Mobile makes ads easy to add into your mobile game: one unified workflow for LevelPlay, AdMob, Yandex.Ads across banners, interstitials and rewarded.
Loading...
Searching...
No Matches
SpaceAdMobile.cs
1using UnityEngine;
2using YandexMobileAds;
3
4namespace SCG.SpaceAdMobile
5{
13 [DefaultExecutionOrder(-10)]
14 [HelpURL("https://ads.yandex.com/helpcenter/en/dev/unity/gdpr")]
15 public class SpaceAdMobile : SpaceAdMobileBase
16 {
21 public static YandexRequestOptions CurrentRequestOptions { get; private set; } = new();
22
24 [Tooltip("Specifies targeting and custom request parameters for Yandex ad requests.")]
26
27 [Tooltip("Indicates whether the user is age-restricted following COPPA guidelines.\n" +
28 "Setting this to true will apply restrictions suitable for under-age users.")]
29 public bool AgeRestrictedUser;
30
31 [Tooltip("Indicates whether the user has consented to data collection and processing in compliance with GDPR.\n" +
32 "User consent is required for collecting and processing personal data of users located in the European Union.")]
33 public bool UserConsent;
34
36 [Tooltip("Controls whether the ad system is allowed to collect and use the user's location data.\n" +
37 "Enabling this can help in delivering more relevant ads based on the user's geographical location.")]
38 public bool LocationConsent;
39
41 protected override void Awake()
42 {
44 base.Awake();
45 }
46
48 protected override void Start()
49 {
51 base.Start();
52 }
53
55 protected override void InitializeAdSystem()
56 {
57#if !LEGACY_YANDEX_MOBILE_ADS
58 YandexAds.SetAgeRestricted(AgeRestrictedUser);
59 YandexAds.SetUserConsent(UserConsent);
60 YandexAds.SetLocationTracking(LocationConsent);
61#else // Supports versions before 8.0.
62 MobileAds.SetAgeRestrictedUser(AgeRestrictedUser);
63 MobileAds.SetUserConsent(UserConsent);
64 MobileAds.SetLocationConsent(LocationConsent);
65#endif
66 }
67
69 public static void ShowDebugPanel()
70 {
71#if UNITY_ANDROID && !LEGACY_YANDEX_MOBILE_ADS
72 YandexAds.ShowDebugPanel();
73#endif
74 }
75 }
76}
RequestOptions RequestOptions
Specifies options for ad requests, such as content rating. See the Google AdMob targeting documentat...
bool AgeRestrictedUser
Indicates whether the user is age-restricted following COPPA guidelines.
override void Awake()
Sets the initial advertising options when the object awakens.
static YandexRequestOptions CurrentRequestOptions
Current Yandex request options used by Yandex ad units. The value is refreshed from the active scene ...
override void Start()
Initializes the advertising system by validating the current options and then starting the ad system ...
bool UserConsent
Indicates whether the user has consented to data collection and processing in compliance with GDPR.
bool LocationConsent
Controls whether the ad system is allowed to collect and use the user's location data.
Base class of the main SpaceAd mobile advertising manager. It provides a framework for initializing a...
Represents a mobile ad manager component specifically designed for integration with Google AdMob serv...
Stores common Yandex request settings for ad loading. Inspector values are converted to targeting,...