@@ -11,8 +11,8 @@ namespace VirtueSky.Ads
11
11
{
12
12
public class Advertising : MonoBehaviour
13
13
{
14
- public bool dontDestroyOnLoad = true ;
15
- public static Advertising Instance ;
14
+ [ SerializeField ] private bool dontDestroyOnLoad = true ;
15
+ private static Advertising _instance ;
16
16
private IEnumerator autoLoadAdCoroutine ;
17
17
private float _lastTimeLoadInterstitialAdTimestamp = DEFAULT_TIMESTAMP ;
18
18
private float _lastTimeLoadRewardedTimestamp = DEFAULT_TIMESTAMP ;
@@ -30,9 +30,9 @@ private void Awake()
30
30
DontDestroyOnLoad ( this . gameObject ) ;
31
31
}
32
32
33
- if ( Instance == null )
33
+ if ( _instance == null )
34
34
{
35
- Instance = this ;
35
+ _instance = this ;
36
36
}
37
37
else
38
38
{
@@ -196,7 +196,7 @@ private void OnConsentInfoUpdated(FormError consentError)
196
196
) ;
197
197
}
198
198
199
- public void LoadAndShowConsentForm ( )
199
+ private void LoadAndShowConsentForm ( )
200
200
{
201
201
Debug . Log ( "LoadAndShowConsentForm Start!" ) ;
202
202
@@ -220,7 +220,7 @@ public void LoadAndShowConsentForm()
220
220
} ) ;
221
221
}
222
222
223
- public void ShowPrivacyOptionsForm ( )
223
+ private void ShowPrivacyOptionsForm ( )
224
224
{
225
225
Debug . Log ( "Showing privacy options form." ) ;
226
226
@@ -261,11 +261,15 @@ private static void AutoInitialize()
261
261
262
262
#region Public API
263
263
264
- public static AdUnit BannerAd => Instance . currentAdClient . BannerAdUnit ( ) ;
265
- public static AdUnit InterstitialAd => Instance . currentAdClient . InterstitialAdUnit ( ) ;
266
- public static AdUnit RewardAd => Instance . currentAdClient . RewardAdUnit ( ) ;
267
- public static AdUnit RewardedInterstitialAd => Instance . currentAdClient . RewardedInterstitialAdUnit ( ) ;
268
- public static AdUnit AppOpenAd => Instance . currentAdClient . AppOpenAdUnit ( ) ;
264
+ public static AdUnit BannerAd => _instance . currentAdClient . BannerAdUnit ( ) ;
265
+ public static AdUnit InterstitialAd => _instance . currentAdClient . InterstitialAdUnit ( ) ;
266
+ public static AdUnit RewardAd => _instance . currentAdClient . RewardAdUnit ( ) ;
267
+ public static AdUnit RewardedInterstitialAd => _instance . currentAdClient . RewardedInterstitialAdUnit ( ) ;
268
+ public static AdUnit AppOpenAd => _instance . currentAdClient . AppOpenAdUnit ( ) ;
269
+ #if VIRTUESKY_ADMOB
270
+ public static void LoadAndShowGDPR ( ) => _instance . LoadAndShowConsentForm ( ) ;
271
+ public static void ShowAgainGDPR ( ) => _instance . ShowPrivacyOptionsForm ( ) ;
272
+ #endif
269
273
270
274
#endregion
271
275
}
0 commit comments