Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Twice IAP after the scene reload

Discussion in 'Unity IAP' started by EyeDev44, Mar 18, 2019.

  1. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    Hello, I find that IAP prize gives twice after the scene get reloaded. When I purchase the small chest after the loading- I get 20 coins, but when I enter some level and exit it- each purchase doubles




    upload_2019-3-18_13-39-51.png
     
  2. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    This issue exists in te Unity editor and on Android test build
     
  3. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    Already 3 times.
    upload_2019-3-18_13-52-6.png
     
  4. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    It's like x2 each scene load
    upload_2019-3-18_13-53-25.png
     
  5. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    The IAP button is also not working:
    upload_2019-3-18_14-18-20.png
     
  6. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    It pronts that IAP_init is destroyed but it's here. unity prevents me from adding a condition with coroutine. upload_2019-3-18_15-11-26.png
     
  7. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    I fixed this S*** with the symbolic condition, but console prints that gameObject that prints it itselves is null.
    upload_2019-3-18_15-14-49.png
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    EyeDev44 likes this.
  9. EyeDev44

    EyeDev44

    Joined:
    Apr 8, 2017
    Posts:
    149
    Solved:


    Code (CSharp):
    1.     private void OnDestroy()
    2.     {
    3.         IAPManager.OnPurchaseConsumable -= IAPManager_OnPurchaseConsumable;
    4.     }