Simply attach this script to one of the main objects (for instance the camera) of your main scene, and you will automatically get the interstitial on back press. (If the AppBrain interstitial has already been shown recently, it won’t be shown again and OnNextLevel() will be called immediately.) Other AppBrain Unity scriptsĮxitInterstitial.cs: Shows an AppBrain interstitial when the user exits your app. When the interstitial is closed by the user, your OnNextLevel() implementation will be called. This call will result in the AppBrain interstitial being shown. You can then add a call to MyInterstitial.OnLevelComplete() where appropriate in your game. Public class MyInterstitial : AppBrainSdk. LevelCompleteInterstitial itself extends Unity’s MonoBehaviour class, so it can easily be used by any game object.įor example, you can add the following script to one of your game’s main objects: The class LevelCompleteInterstitial is meant to be extended so you can override its OnNextLevel() method. You can use the script LevelCompleteInterstitial.cs to do this. The recommended way to use AppBrain in a game is to show the AppBrain interstitial when the player completes a level. The scripts are located in /Assets/Plugins/Android/AppBrain/Scripts. To make integration even easier, the AppBrain SDK for Unity comes bundled with some scripts for common use cases. Open Unity with your project and call AppBrain functions where appropriate Unzip appbrain-unity.zip to your Unity project’s Assets folder, e.g. Unity integration stepsĭownload appbrain-unity.zip from the AppBrain SDK GitHub page This section describes how to integrate the AppBrain SDK into your Unity app and start monetizing it.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |