Search Unity

Bug? can't edit IAP button component script

Discussion in 'Unity IAP' started by Aokkii, Apr 9, 2021.

  1. Aokkii

    Aokkii

    Joined:
    Nov 3, 2013
    Posts:
    118
    When i tried to edit the IAP button script to change the title, description and price Texts fields into TextmeshProUI,
    adding namespaces like using TMPro; are not recognized by visual studio nor unity editor; throwing errors.


    is it because now that script is part of the package and somehow are protected from editing?

    if thats the case, please change those old unity text fields into textmeshpro texts.
    Before 3.0.0 i could edit it just fine:(
     
    Last edited: Apr 9, 2021
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you add the TMPro reference to other scripts? Your error does not look related to IAP, it looks like that namespace is not available. If you can save the file you are able to edit and the the error shows you did make an edit.
     
  3. Aokkii

    Aokkii

    Joined:
    Nov 3, 2013
    Posts:
    118
    @jeffdunity

    Well technically you are correct, I can edit the script, but it doesn't recognize any new namespaces. throws error that prevent from entering playmode.

    is it because is not a monobehaviour script?
    is it because package scripts are protected from editing(or adding new namespaces)?


    yes i can add it to other scripts and works like it should, and was able to do it to this script just fine before the IAP was a full package.(before 3.0.0)
     
    Last edited: Apr 9, 2021
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @PipebknOT Yes, I see what you mean, I am able to reproduce. I'm not able to add "using TMPro" in IAPButton.cs when using IAP 3.0.1. I suspect your monobehavior mention may be correct, I will confirm. Update - confirmed the issue with the team here, unfortunately we don't have an immediate solution. We are in the process of revamping Codeless IAP but may be a few months out.
     
    Last edited: Apr 9, 2021
  5. Aokkii

    Aokkii

    Joined:
    Nov 3, 2013
    Posts:
    118
    good to know that, I will go for the Coded IAP(scripted) route for now.
     
    Last edited: Apr 13, 2021
    JeffDUnity3D likes this.
  6. devasi

    devasi

    Joined:
    Nov 29, 2017
    Posts:
    4
    HI there
    Codeless IAP button script is not editable I want to write the logic for when the restore was successful.
    Thanks
     

    Attached Files:

  7. devasi

    devasi

    Joined:
    Nov 29, 2017
    Posts:
    4
    And it's no invoking purchase complete method when it restored
     

    Attached Files:

  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, you can edit IAPButton.cs but it is not supported (Keep in mind that "Codeless" is in the name, and you are suggesting to write code). Any changes you make however would be discarded if the package was updated. Please use Scripted IAP. Otherwise you will need to use the Codeless IAP Listener to see the restore callback. But since you need to make changes, now is the time to move to Scripted IAP! We need to update Codeless, we are looking into options. It currently doesn't support receipt validation, required by Apple, nor deferred purchases, required by Google.
     
    devasi likes this.