Home > Resources > Platforms > Cross-Platform Engines

Adding a Plugin to Your Unity Project

Adding a Plugin to a Unity Project

To add a Unity package to your project, follow these steps:

  1. In your Unity development environment, open the Project tab.
  2. In the left pane of the Project tab, right click the Assets folder, then select Import PackageCustom Package… in the context menu. An Import package… window opens.
  3. In the Import package… window, navigate to the folder containing the file with the .unitypackage extension that represents the plugin you wish to import.
  4. Select the .unitypackage file, and click Open. An Importing package window opens.
  5. In the Importing package window, review the list of files to be imported and check for conflicts with files already in your project. If a conflict exists, save any local changes somewhere outside of your project.
  6. Click Import. The package’s files are added to the Assets folder.
  7. If you saved any local changes outside of your project, use your favorite file merging software to merge the differences between the file(s) you imported and the file(s) you saved.

In-App Purchasing v2 Additional Unity Setup Steps for Android Deployment

If you use the IAP v2 Unity plugin in your app, you must update your manifest to declare the IAP response receiver before creating your Android APK. We included a sample Android Manifest with the IAP response receiver in Assets/Plugins/Android.

If you already have an Android manifest you can add the following under your application XML node:

<receiver android:name="com.amazon.device.iap.ResponseReceiver">
  <intent-filter>
    <action
      android:name="com.amazon.inapp.purchasing.NOTIFY"
      android:permission="com.amazon.inapp.purchasing.Permission.NOTIFY" />
  </intent-filter>
</receiver>

If you don’t already have an Android Manifest, you can rename IapSdkCptServiceSampleAndroidManifest.xml to AndroidManifest.xml. You should update the package, android:versionName, and android:versionCode attributes of the manifest node.