Repository navigation
Unity Plugin
- Download
MobFoxUnityPluginDistributables.zipand Extract it’s content into a temporary directory. - In your Unity project, create folder
Assets/Plugin/Android.
Copy the following fromPlugins/Androidinto that directory:
AndroidManifest.xml file
libs directory (and content)
res directory (and content) - In your Unity project, create a folder
Assets/Scripts.
Copy the following file from Scripts directory into that directory:MobFox.cs
- In your Unity project, create a game object called
MobFoxObject.
Attach the MobFox script to it. - Fill the
Mob Fox Banner Inventory Hashfield with your banner inventory hash. - Fill the
Mob Fox Interstitial Inventory Hashfield with your Interstitial inventory hash. - Fill the
Mob Fox Game Object Namefield with the name of the game object if you use one other thanMobFoxObject.
- Use
MobFox.ShowMobFoxBannerto display a banner ad. - Use
MobFox.ShowMobFoxSmartBannerto display a smart banner (full width, height 50 / 90). - Use
MobFox.CreateAndShowMobFoxInterstitialto display a interstitial ad. - To only load the interstitial use
MobFox.CreateMobFoxInterstitial.
show the interstitial in theinterstitialReadyevent with theMobFox.ShowMobFoxInterstitialmethod. - Find callback functions in MobFox script to handle events:
- banner:
- bannerReady
- bannerError
- bannerClosed
- bannerClicked
- bannerFinished
- interstitial:
- interstitialReady
- interstitialError
- interstitialClosed
- interstitialClicked
- interstitialFinished
- Its possible to change the location and dimensions of banner ads by altering the parameters passed in
ShowMobFoxBanner_Android.
(0, 0, 320, 50)are the default. - By default, use of location info is disabled. To enable it, you can call
MobFox.SetUseLocation(true).
This feature lets you develop with unity and use MobFox's SDK.
Run Unity Demo project : https://github.com/mobfox/MobFox-iOS-SDK-Core-Lib/tree/master/Plugins/UnityDemo
Instructions:
- In your Unity project, create a folder
Assets/Plugin/iOS. Copy to that directory the filesMobFoxUnityPlugin.handMobFoxUnityPlugin.mmfromMobFox-iOS-SDK-Core-Lib/Plugins/Unity/,MobFoxSDKCore.bundleandMobFoxSDKCore.frameworkfromMobFox-iOS-SDK-Core-Lib:
MobFoxSDKCore.bundleMobFoxSDKCore.frameworkMobFoxUnityPlugin.hMobFoxUnityPlugin.mm
- In your Unity project, create a folder
Assets/Scripts. Copy the following file from Scripts directory into that directory:
MobFox.cs

- In your Unity project, create a game object called
MobFoxObject. Attach the MobFox script to it.

-
Fill the ‘Mob Fox Banner Inventory Hash’ field with your MobFox hash id for banners.
-
Fill the ‘Mob Fox Interstitial Inventory Hash’ field with your MobFox hash id for interstitials.
-
Fill the ‘Mob Fox Game Object Name’ field with the name of the game object if you use one other than ‘MobFoxObject’.
-
Now you can use
MobFox.ShowMobFoxBannerto display a banner ad, and/orMobFox.ShowMobFoxInterstitialto display an interstitial ad.
Inside the MobFox script you can find the callback functions you can use to handle events related to the banner ads (bannerReady, bannerError, bannerClosed, bannerClicked, bannerFinished) or interstitial ads (interstitialReady, interstitialError, interstitialClosed, interstitialClicked, interstitialFinished).
You can also change the location and dimensions of banner ads by altering the parameters passed in ShowMobFoxBanner_iPhone
(0, 0, 320, 50) are the default.