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
AdType.cs
1using UnityEngine;
2
3namespace SCG.SpaceAdMobile
4{
8 public enum AdType : byte
9 {
13 [Tooltip("Persistent banner advertising format.")]
14 Banner = 0,
15
19 [Tooltip("Fullscreen interstitial advertising format.")]
21
25 [Tooltip("Fullscreen rewarded advertising format.")]
27
28#if !LEVELPLAY_MOBILE_ADS
32 [Tooltip("Fullscreen app-open advertising format.")]
34#endif
35
36#if GOOGLE_MOBILE_ADS
40 [Tooltip("Fullscreen rewarded-interstitial advertising format.")]
41 RewardedInterstitial = 4,
42
46 [Tooltip("Native overlay advertising format.")]
47 Native = 5,
48#endif
49 }
50
55 public static class AdTypeExtensions
56 {
62 public static bool IsFullscreenAd(this AdType adType) => adType switch
63 {
64 AdType.Interstitial => true,
65 AdType.Rewarded => true,
66#if !LEVELPLAY_MOBILE_ADS
67 AdType.AppOpen => true,
68#endif
69#if GOOGLE_MOBILE_ADS
70 AdType.RewardedInterstitial => true,
71#endif
72 _ => false
73 };
74
80 public static AutoMuteAdTypes ToAutoMuteAdType(this AdType adType) => adType switch
81 {
84#if !LEVELPLAY_MOBILE_ADS
86#endif
87#if GOOGLE_MOBILE_ADS
88 AdType.RewardedInterstitial => AutoMuteAdTypes.RewardedInterstitial,
89#endif
91 };
92 }
93}
static bool IsFullscreenAd(this AdType adType)
Determines whether an ad format displays fullscreen content.
Definition AdType.cs:62
static AutoMuteAdTypes ToAutoMuteAdType(this AdType adType)
Converts an ad format to its corresponding auto-mute flag.
Definition AdType.cs:80
Provides classification and conversion helpers for common ad formats. The helpers identify fullscreen...
Definition AdType.cs:56
AdType
Identifies the advertising format exposed by an ad unit.
Definition AdType.cs:9
@ Interstitial
Interstitial ad format.
Definition AdType.cs:20
@ Banner
Banner ad format.
Definition AdType.cs:14
@ Rewarded
Rewarded ad format.
Definition AdType.cs:26
@ AppOpen
App open ad format.
Definition AdType.cs:33
AutoMuteAdTypes
Specifies fullscreen ad formats that mute Unity audio while the ad is displayed.
@ None
No ad format is muted automatically.