Skip to content

Commit 1a9260a

Browse files
committed
Update Advertising.cs
1 parent 015ffc0 commit 1a9260a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Runtime/General/Advertising.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace VirtueSky.Ads
1111
{
1212
public class Advertising : MonoBehaviour
1313
{
14+
public bool dontDestroyOnLoad = true;
1415
public static Advertising Instance;
1516
private IEnumerator autoLoadAdCoroutine;
1617
private float _lastTimeLoadInterstitialAdTimestamp = DEFAULT_TIMESTAMP;
@@ -24,7 +25,11 @@ public class Advertising : MonoBehaviour
2425

2526
private void Awake()
2627
{
27-
DontDestroyOnLoad(this.gameObject);
28+
if (dontDestroyOnLoad)
29+
{
30+
DontDestroyOnLoad(this.gameObject);
31+
}
32+
2833
if (Instance == null)
2934
{
3035
Instance = this;

0 commit comments

Comments
 (0)