Hi there!
I've made a "Remove Ads" purchase option in my game and am trying to implement it.
Currently, in my **IAP Manager script** I save a variable to PlayerPrefs when you click and complete purchase on the Remove Ads Button
----------
// After purchase is completed
var adFree = 1;
PlayerPrefs.SetInt("AdFree", adFree);
----------
I then want to call adFree in a different script to see if it's been purchased before playing ads.
----------
I have two main questions.
----------
1. Should I be setting the default (i.e. adFree = 0) somewhere?
2. When I try and call adFree (using this method:
----------
https://forum.unity.com/threads/playerprefs-setbool-and-playerprefs-getbool.12795/) in my **Ad Manager script** I get errors.
----------
I apologize if this is a dumb question! I'm new to Unity and coding. Any clarification or tips would be very helpful!
↧