User Manual

Getting Started

Overview

The Mobile Monetization Plugin is a comprehensive solution that combines Advertisement, In-App Purchases (IAP), Offerwalls, and System utilities into a unified framework. It handles initialization order, SDK dependencies, and cross-platform compatibility, allowing you to focus on gameplay logic.

Installation

  1. Open Window > Package Manager.
  2. Click the + button in the top-left corner > Add package from git URL….
  3. Paste the following link:
    https://github.com/Mafty63/Mobile-Monetization.git?path=/Assets/Mobile Monetization
  4. Click Add.

The package will appear in your Packages folder (not Assets) under Mobile Monetization.

Import Samples

To avoid creating settings from scratch, we recommend importing the samples:

  1. In Package Manager, select Mobile Monetization.
  2. Go to the Samples tab.
  3. Click Import next to Examples and Resources.
  4. This adds pre-configured settings and prefabs to Assets/Samples/Mobile Monetization/[Version]/Examples and Resources/.

1. Core Setup (Main System)

The Main System acts as the brain of the plugin, initializing all other modules in the correct order.

Setup Steps

  1. Prepare Settings:
    • Option A (Recommended): Use the MainSystemSettings found in the imported Samples folder.
    • Option B (Manual): Right-click in Project view > Mobile Core > Main System Settings.
  2. Assign Modules (If creating manually):
    • Set Core Module to your SystemModuleInitializer asset.
    • Add other modules (Ads, IAP, Offerwall) to the Modules list.
  3. Scene Setup:
    • In your first scene (Splash/Loading), add an empty GameObject.
    • Add the MainSystemManager component.
    • Drag the MainSystemSettings (from Samples or created manually) into the Init Settings slot.
    • This object will persist (DontDestroyOnLoad) automatically.

2. Enabling Third-Party SDKs (Define System)

This plugin uses a smart Define System to automatically toggle code based on installed SDKs.

  1. Install SDK: Import your third-party SDKs (e.g., AdMob, Unity Ads, LevelPlay, Unity IAP, etc.) into the project.
  2. Enable Defines:
    • Go to Tools > MobileCore > Define Symbols Manager.
    • Click Refresh All Define Symbols.
    • The system will scan your project for the SDK classes (configured in Assets/Mobile Monetization/Define System/) and automatically add the necessary Scripting Define Symbols to Player Settings.

3. Advertisement Setup

Unified API for AdMob, Unity Ads, IronSource (LevelPlay), AppLovin, and more.

  1. Enable Module:
    • Open your Main System Settings asset.
    • Under the MODULES section, look for Advertisement Module.
    • If it’s missing, click Add Module > Advertisement Module.
    • Click the ENABLE/DISABLE button to ensure it reads DISABLE (meaning it is currently ENABLED) or check if the section is expanded and active. Actually, the button label shows the action to take, so if it says “DISABLE”, it is currently Enabled. ensure the module is Enabled.
  2. Assign Settings:
    • Expand the Advertisement Module configuration.
    • Locate the Settings field (AdsSettings).
    • Drag your AdsSettings asset (from Samples or created manually) into this slot.
    • Crucial: If this slot is empty, the Ads Manager will fail to initialize.
  3. Configure Providers:
    • Select the AdsSettings asset itself.
    • Enable providers for Banner, Interstitial, and Rewarded.
    • Privacy: Configure GDPR and IDFA settings in the “Privacy & Compliance” foldout.
    • Timing: Adjust interstitial delays and auto-show behavior in “Interstitial Timing”.
  4. Configure Providers in AdsSettings:
    • Select the AdsSettings asset (or click OPEN ADS SETTINGS in the Module Inspector).
    • Important: Ensure your desired provider’s Define Symbol is active (see Section 2). If the symbol (e.g., ADMOB_INSTALLED) is not active, the provider will not appear in the configuration tabs or dropdowns.
    • Provider Settings: Use the tabs to configure specific settings for each provider (e.g., AdMob App ID, Unity Ads Game ID).
    • Ad Type Selection: In the “Ad Type Providers” section, select which provider to use for each ad format (Banner, Interstitial, Rewarded).

4. In-App Purchases (IAP) Setup

Wrapper around Unity IAP for easier product management.

  1. Enable Module:
    • Open Main System Settings and find In-App Purchase Module.
    • Ensure the module is Enabled.
    • Assign your IAPSettings asset to the Settings slot.
  2. Define Product Keys:
    • Open your IAPSettings asset (or click OPEN IAP SETTINGS in the Module Inspector).
    • Click the Edit ProductKeyType Enum button.
    • Add your internal product keys (e.g., REMOVE_ADS, COIN_PACK_SMALL). These keys act as safe references in your code.
  3. Configure Products:
    • In IAPSettings, click Add Product to create a new item.
    • The inspector uses a custom drawer (IAPItemDrawer) for clear configuration:
      • Type: Select Consumable, NonConsumable, or Subscription.
      • Key Type: Select the internal key you defined in step 2.
      • Android ID & iOS ID: Enter the store-specific IDs (e.g., com.game.coinpack).

5. Offerwall Setup

Integration for Offerwall providers like Tapjoy.

  1. Enable Module:
    • Open Main System Settings and find Offerwall Manager.
    • Ensure the module is Enabled.
    • Assign your OfferwallSettings asset to the Settings slot.
  2. Configure Offerwall:
    • Open your OfferwallSettings asset (or click OPEN OFFERWALL SETTINGS in the Module Inspector).
    • General Settings: Enable Test Mode and System Logs as needed.
    • Tapjoy Configuration:
      • Configure your Tapjoy keys in the container fields.
      • Note: If you haven’t installed the SDK, click the Download Tapjoy SDK button to get the latest version (v13.x+ recommended).

6. System Utilities

Helper tools for device configuration and common UI actions.

1. Core Configuration

The Core Module (assigned in Main System Settings) provides essential device settings:

  • Frame Rate: Configure target frame rates for default and battery-saving modes, or set to Auto to match the screen’s refresh rate.
  • Sleep Timeout: Control device sleep behavior (e.g., set to “Never Sleep” to keep the screen on during gameplay).

2. UI Helpers (SystemManager)

Static methods to access the built-in system canvas for feedback:

// Show a floating "toast" message
SystemManager.ShowMessage("Level Completed!", 2.5f);

// Blocking Loading Screen
SystemManager.ShowLoadingPanel();
SystemManager.ChangeLoadingMessage("Downloading Assets...");
// ... async operation ...
SystemManager.HideLoadingPanel();

Next Steps

For detailed API documentation on the major revenue modules, see: