Skip to content

Commit 589eceb

Browse files
authored
Merge pull request #65 from VirtueSky/dev
Dev
2 parents 0357855 + ec9785e commit 589eceb

26 files changed

+70
-232
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@
2323
### 1: Download the repository and drop it into folder `Assets`
2424
### 2: Add the line below to `Packages/manifest.json`
2525

26-
for version `3.4.2`
26+
for version `3.4.3`
2727
```json
28-
"com.virtuesky.sunflower":"https://github.com/VirtueSky/sunflower.git#3.4.2",
28+
"com.virtuesky.sunflower":"https://github.com/VirtueSky/sunflower.git#3.4.3",
2929
```
3030

3131
## Includes modules
3232

3333
```bash
3434
├── Core (Update only called once in Monobehaviour, Delay...)
35-
├── ATT_IOS
3635
├── Advertising (Support for Max, Admob and IronSource)
3736
├── In App Purchase (IAP)
3837
├── Asset Finder

VirtueSky/ATT_IOS.meta

Lines changed: 0 additions & 8 deletions
This file was deleted.

VirtueSky/ATT_IOS/Editor.meta

Lines changed: 0 additions & 8 deletions
This file was deleted.

VirtueSky/ATT_IOS/Editor/PostBuildStep.cs

Lines changed: 0 additions & 98 deletions
This file was deleted.

VirtueSky/ATT_IOS/Editor/PostBuildStep.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

VirtueSky/ATT_IOS/Editor/Virtuesky.Sunflower.ATTIOS.Editor.asmdef

Lines changed: 0 additions & 16 deletions
This file was deleted.

VirtueSky/ATT_IOS/Editor/Virtuesky.Sunflower.ATTIOS.Editor.asmdef.meta

Lines changed: 0 additions & 7 deletions
This file was deleted.

VirtueSky/Advertising/Runtime/Admob/AdmobAdClient.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ void RegisterAppStateChange()
6262

6363
void OnAppStateChanged(GoogleMobileAds.Common.AppState state)
6464
{
65-
if (state == GoogleMobileAds.Common.AppState.Foreground && adSetting.AdmobAppOpenVariable.AutoShow &&
66-
!AdStatic.isShowingAd)
65+
if (state == GoogleMobileAds.Common.AppState.Foreground && adSetting.AdmobAppOpenVariable.autoShow)
6766
{
6867
if (adSetting.UseAdmob) ShowAppOpen();
6968
}

VirtueSky/Advertising/Runtime/Admob/AdmobAdUnitVariable.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public void SetIdRuntime(string unitId)
3636
public override AdUnitVariable Show()
3737
{
3838
ResetChainCallback();
39-
if (!Application.isMobilePlatform || string.IsNullOrEmpty(Id) || AdStatic.IsRemoveAd) return this;
39+
if (!Application.isMobilePlatform || string.IsNullOrEmpty(Id) || AdStatic.IsRemoveAd ||
40+
!IsReady()) return this;
4041
ShowImpl();
4142
return this;
4243
}

VirtueSky/Advertising/Runtime/Admob/AdmodUnitVariable/AdmobAppOpenVariable.cs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ namespace VirtueSky.Ads
1313
[EditorIcon("icon_scriptable")]
1414
public class AdmobAppOpenVariable : AdmobAdUnitVariable
1515
{
16-
[Tooltip("Automatically show AppOpenAd when app status is changed"), SerializeField]
17-
private bool autoShow = false;
16+
[Tooltip("Automatically show AppOpenAd when app status is changed")]
17+
public bool autoShow = false;
18+
19+
[Tooltip("Time between closing the previous full-screen ad and starting to show the app open ad - in seconds")]
20+
public float timeBetweenFullScreenAd = 2f;
1821

1922
public bool useTestId;
2023
#if VIRTUESKY_ADS && VIRTUESKY_ADMOB
2124
private AppOpenAd _appOpenAd;
2225
#endif
2326
private DateTime _expireTime;
24-
public bool AutoShow => autoShow;
2527

2628
public override void Init()
2729
{
@@ -48,21 +50,13 @@ public override void Load()
4850
public override bool IsReady()
4951
{
5052
#if VIRTUESKY_ADS && VIRTUESKY_ADMOB
51-
return _appOpenAd != null && _appOpenAd.CanShowAd() && DateTime.Now < _expireTime;
53+
return _appOpenAd != null && _appOpenAd.CanShowAd() && DateTime.Now < _expireTime &&
54+
(DateTime.Now - AdStatic.AdClosingTime).TotalSeconds > timeBetweenFullScreenAd;
5255
#else
5356
return false;
5457
#endif
5558
}
5659

57-
public override AdUnitVariable Show()
58-
{
59-
ResetChainCallback();
60-
if (!Application.isMobilePlatform || string.IsNullOrEmpty(Id) || AdStatic.IsRemoveAd ||
61-
!IsReady()) return this;
62-
ShowImpl();
63-
return this;
64-
}
65-
6660
protected override void ShowImpl()
6761
{
6862
#if VIRTUESKY_ADS && VIRTUESKY_ADMOB
@@ -110,7 +104,7 @@ private void OnAdClicked()
110104
private void OnAdOpening()
111105
{
112106
AdStatic.waitAppOpenDisplayedAction?.Invoke();
113-
AdStatic.isShowingAd = true;
107+
AdStatic.IsShowingAd = true;
114108
Common.CallActionAndClean(ref displayedCallback);
115109
OnDisplayedAdEvent?.Invoke();
116110
}
@@ -124,7 +118,7 @@ private void OnAdFailedToShow(AdError obj)
124118
private void OnAdClosed()
125119
{
126120
AdStatic.waitAppOpenClosedAction?.Invoke();
127-
AdStatic.isShowingAd = false;
121+
AdStatic.IsShowingAd = false;
128122
Common.CallActionAndClean(ref closedCallback);
129123
OnClosedAdEvent?.Invoke();
130124
Destroy();

0 commit comments

Comments
 (0)