Skip to content

Commit 068dcc5

Browse files
committed
Update IapManager.cs
1 parent fbd8160 commit 068dcc5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Runtime/IapManager.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace VirtueSky.Iap
1010
{
1111
public class IapManager : MonoBehaviour, IDetailedStoreListener
1212
{
13+
public bool dontDestroyOnLoad = true;
1314
public static IapManager Instance;
1415
public static event Action<string> OnPurchaseSucceedEvent;
1516
public static event Action<string> OnPurchaseFailedEvent;
@@ -23,7 +24,11 @@ public class IapManager : MonoBehaviour, IDetailedStoreListener
2324

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

0 commit comments

Comments
 (0)