Question

Unity setup with several scenes

  • 16 November 2023
  • 2 replies
  • 70 views

Badge

Hello!

I’m integrating RevenueCat in a Unity app with several scenes.

In the Scene 1 I have created a game object that includes the reference to the “Purchases” script. In this scene with have all the logic to manage subscriptions.

This scene open another scenes where we don’t have a reference to “Purchases” script (it’s not needed).

The usual user workflow is Scene 1 → Scene 2 → Scene 1 → Scene 2,…

My questions is: Every time the first scene is loaded the “Purchases” script calls to Configure method but I have read that this is not a good approach. How are you guys doing this? Is it ok to call Configure method every time the user open the Scene 1?

 

Thank you!

 


2 replies

Userlevel 3
Badge +6

Hey @juan.riveros,

I’m definitely not an expert in Unity so I hope other developers can chime in to give you an idea of how they configure, but I can confirm that configuring multiple times is not a good idea and can lead to some unexpected behavior and crashes. 

It could be help to check out our sample unity app here: https://github.com/RevenueCat/purchases-unity/tree/main/Subtester

 

Badge

Hi Kaitlin,

Thanks for your response. I have checked the sample but it uses only one scene.

It seems like not many users are using Unity with RevenueCat… red flag? 🤔

 

Reply