### Simple Scene Example Path Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/README.md Path to the Simple Scene example for testing the integration. ```text Assets/Adinmo/Examples/Simple Scene.unity ``` -------------------------------- ### Install AdInMo Unity Plugin via Git URL Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/README.md Git URL to add the AdInMo Unity plugin via Unity Package Manager. Always gets the latest updates. ```text https://github.com/AdInMo-Ltd/unity-plugin.git ``` -------------------------------- ### Install AdInMo Unity Plugin Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/PRE-PURCHASE-HOOKS.md Installation URL for the AdInMo Unity plugin version 3.2.315-beta.1. ```text https://github.com/AdInMo-Ltd/unity-plugin.git#v3.2.315-beta.1 ``` -------------------------------- ### Verify Git and Use UPM Git URL with Version Tag Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/README.md Check that Git is installed and accessible, then use the UPM Git URL with a specific version tag to install the AdInMo Unity plugin. The URL is provided as a fallback when the Package Manager installation fails. ```bash git --version ``` ```text https://github.com/AdInMo-Ltd/unity-plugin.git#v3.2.314 ``` -------------------------------- ### Install Specific Version of AdInMo Unity Plugin Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/README.md Git URL with a version tag to install a specific version of the AdInMo Unity plugin. ```text https://github.com/AdInMo-Ltd/unity-plugin.git#v3.2.314 ``` -------------------------------- ### Initialize AdInMo Manager with Game Key Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/README.md Call in your game initialization to configure the AdInMo SDK with your game key. ```csharp AdinmoManager.Initialize("your-game-key-here"); ``` -------------------------------- ### Placement Prefab Paths Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/README.md Paths to pre-built placement prefabs for UI Image, 3D Mesh, and 2D Sprite placements. ```text Assets/Adinmo/Prefabs/Images/ - UI Image placements Assets/Adinmo/Prefabs/Meshes/ - 3D Mesh placements Assets/Adinmo/Prefabs/Sprites/ - 2D Sprite placements ``` -------------------------------- ### Initialize AdInMo IAP with UnityPurchasingAdInMoExtensions Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/README.md Initializes AdInMo IAP integration with Unity IAP v4/v5. Call this extension method on the Unity IAP builder to enable contextual product placement. ```csharp // Enable IAP integration with Unity IAP v4/v5 UnityPurchasingAdInMoExtensions.InitializeWithAdInMo(this, builder); ``` -------------------------------- ### PrePurchaseEventArgs API Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/PRE-PURCHASE-HOOKS.md Event arguments class for the OnPrePurchase event, containing ProductId and Product. ```csharp public class PrePurchaseEventArgs { public string ProductId { get; } public Product Product { get; } } ``` -------------------------------- ### Add Audio Placement with AdinmoAudioPlacement Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/README.md Adds an audio placement component to a GameObject for immersive sound advertising. Requires an AudioSource component on the same GameObject. ```csharp // Add audio placement AudioSource audioSource = GetComponent(); AdinmoAudioPlacement audioAd = gameObject.AddComponent(); ``` -------------------------------- ### OnPrePurchase Event Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/PRE-PURCHASE-HOOKS.md Documentation for the OnPrePurchase event hook, including usage for both Unity IAP v4 and v5, automatic and paused modes, and the PrePurchaseEventArgs class. ```APIDOC ## [EVENT] OnPrePurchase ### Description Event that fires before an IAP purchase starts. Use it to run custom logic such as attaching product-specific callbacks, tracking analytics, or setting up reward handlers. ### Event OnPrePurchase ### Event Arguments - **args** (PrePurchaseEventArgs) - Contains ProductId and Product information. ### Usage #### Automatic Mode (Default) Event fires and purchase continues immediately. **Unity IAP v4:** ```csharp AdInMoIapProxy.OnPrePurchase += (args) => { Debug.Log($"About to purchase: {args.ProductId}"); AttachCallbacks(args.ProductId); }; ``` **Unity IAP v5:** ```csharp var m_StoreController = new AdinmoStoreController(); m_StoreController.OnPrePurchase += (args) => { Debug.Log($"About to purchase: {args.ProductId}"); AttachCallbacks(args.ProductId); }; ``` #### Paused Mode (Advanced) Purchase waits for manual confirmation. **Unity IAP v4:** ```csharp AdInMoIapProxy.PauseBeforePurchase = true; AdInMoIapProxy.OnPrePurchase += (args) => { // Do validation/setup ValidateAsync(args.ProductId, () => { // Continue when ready AdInMoIapProxy.ContinuePurchase(args.ProductId); }); }; ``` **Unity IAP v5:** ```csharp var m_StoreController = new AdinmoStoreController(); m_StoreController.PauseBeforePurchase = true; m_StoreController.OnPrePurchase += (args) => { // Do validation/setup ValidateAsync(args.ProductId, () => { // Continue when ready m_StoreController.ContinuePurchase(args.ProductId); }); }; ``` ### Note If you don't call `ContinuePurchase()`, the purchase will not start. ### Event Arguments Class ```csharp public class PrePurchaseEventArgs { public string ProductId { get; } public Product Product { get; } } ``` ``` -------------------------------- ### AdinmoManager Prefab Path Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/README.md Path to the AdinmoManager prefab to drag into your scene for basic integration. ```text Assets/Adinmo/Prefabs/AdinmoManager.prefab ``` -------------------------------- ### ContinuePurchase Method Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/PRE-PURCHASE-HOOKS.md Documentation for the ContinuePurchase method used to resume a paused purchase flow. ```APIDOC ## [METHOD] ContinuePurchase ### Description Method that resumes a paused purchase flow. Must be called to start the purchase when PauseBeforePurchase is true. ### Method ContinuePurchase ### Parameters - **productId** (string) - Required - The product ID of the purchase to continue. ### Usage **Unity IAP v4:** ```csharp AdInMoIapProxy.ContinuePurchase(args.ProductId); ``` **Unity IAP v5:** ```csharp m_StoreController.ContinuePurchase(args.ProductId); ``` ``` -------------------------------- ### Automatic Mode Unity IAP v5 Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/PRE-PURCHASE-HOOKS.md Automatic mode for Unity IAP v5: event fires and purchase continues immediately. ```csharp var m_StoreController = new AdinmoStoreController(); m_StoreController.OnPrePurchase += (args) => { Debug.Log($"About to purchase: {args.ProductId}"); AttachCallbacks(args.ProductId); }; ``` -------------------------------- ### PauseBeforePurchase Property Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/PRE-PURCHASE-HOOKS.md Documentation for the PauseBeforePurchase property that enables paused mode for pre-purchase hooks. ```APIDOC ## [PROPERTY] PauseBeforePurchase ### Description Property that when set to true, pauses the purchase flow until ContinuePurchase is called. ### Property PauseBeforePurchase ### Type bool ### Usage **Unity IAP v4:** ```csharp AdInMoIapProxy.PauseBeforePurchase = true; ``` **Unity IAP v5:** ```csharp var m_StoreController = new AdinmoStoreController(); m_StoreController.PauseBeforePurchase = true; ``` ``` -------------------------------- ### Automatic Mode Unity IAP v4 Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/PRE-PURCHASE-HOOKS.md Automatic mode for Unity IAP v4: event fires and purchase continues immediately. ```csharp AdInMoIapProxy.OnPrePurchase += (args) => { Debug.Log($"About to purchase: {args.ProductId}"); AttachCallbacks(args.ProductId); }; ``` -------------------------------- ### Paused Mode Unity IAP v5 Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/PRE-PURCHASE-HOOKS.md Paused mode for Unity IAP v5: purchase waits for manual confirmation via ContinuePurchase(). ```csharp var m_StoreController = new AdinmoStoreController(); m_StoreController.PauseBeforePurchase = true; m_StoreController.OnPrePurchase += (args) => { // Do validation/setup ValidateAsync(args.ProductId, () => { // Continue when ready m_StoreController.ContinuePurchase(args.ProductId); }); }; ``` -------------------------------- ### Paused Mode Unity IAP v4 Source: https://github.com/adinmo-ltd/unity-plugin/blob/main/PRE-PURCHASE-HOOKS.md Paused mode for Unity IAP v4: purchase waits for manual confirmation via ContinuePurchase(). ```csharp AdInMoIapProxy.PauseBeforePurchase = true; AdInMoIapProxy.OnPrePurchase += (args) => { // Do validation/setup ValidateAsync(args.ProductId, () => { // Continue when ready AdInMoIapProxy.ContinuePurchase(args.ProductId); }); }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.