diff --git a/.gitignore b/.gitignore index 6024f91..df9dccf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store -!Packages/com.liftoff.windows-ads/Samples~/ -!Packages/com.liftoff.windows-ads/Samples~/** +# Claude Code settings +.claude/ +CLAUDE.local.md diff --git a/AndroidIOS/README.md b/AndroidIOS/README.md new file mode 100644 index 0000000..28000f1 --- /dev/null +++ b/AndroidIOS/README.md @@ -0,0 +1,40 @@ +# Liftoff Monetize — Android / iOS Unity Test App + +Test app for the **Vungle SDK by Liftoff** Unity plugin (`io.liftoff.vungleads`) on Android and iOS. + +The Android/iOS plugin is developed in a private repository and released to the [Unity Asset Store](https://assetstore.unity.com/) as **Vungle SDK by Liftoff**. Unlike Windows, the Android/iOS bridge ships as *source* inside the package — Java glue compiled by Unity's Gradle build and Objective-C glue compiled by the generated Xcode project — with the native VungleAds SDK resolved as a prebuilt dependency (Maven / CocoaPods) via External Dependency Manager (EDM4U). + +## What's in this folder + +| Folder | Contents | +| --- | --- | +| `VungleSDKSampleApp/` | Unity project with the plugin's sample scenes and scripts (interstitial, rewarded, banner, native, and RectTransform-attached banner formats). | + +The project references the package locally from [`../Packages/io.liftoff.vungleads/`](../Packages/io.liftoff.vungleads/) via a `file:` dependency in `Packages/manifest.json`, so it always exercises the package version checked into this repo — the same pattern the Windows sample app uses with the Windows package. + +## Getting started + +1. Open `VungleSDKSampleApp/` in Unity **6000.0.66f2 or newer** (developed with 6000.3.16f1). Unity regenerates `Library/` and the remaining project files on first open. +2. In **Build Settings**, switch the platform to **Android** or **iOS**. +3. Set your own **Company Name / Product Name / Bundle Identifier** in Player Settings. +4. Replace the app ID and placement IDs in `Assets/Samples/Scripts/VungleConstants.cs` with values from your Liftoff Monetize dashboard. +5. Add the scenes under `Assets/Samples/Scenes/` to Build Settings (start with `LaunchScene`). + The sample UI is generated at runtime with TextMeshPro; the required **TMP Essential + Resources** are already included at `Assets/TextMesh Pro/` (if they're ever removed, + re-import via *Window → TextMeshPro → Import TMP Essential Resources*). + Ad text can be in any language, so the sample registers dynamic OS-font fallbacks at + startup for non-Latin glyphs — publishers rendering native-ad text themselves need an + equivalent font-fallback strategy in their own UI. +6. Build: + - **Android** — EDM4U resolves `com.vungle:vungle-ads` from Maven during the Gradle build (run *Assets → External Dependency Manager → Android Resolver → Resolve* if needed). + - **iOS** — EDM4U generates a `Podfile` for the `VungleAds` CocoaPod; open the generated `.xcworkspace` after `pod install`. + +## Ad formats covered by the sample scenes + +| Scene | Format | +| --- | --- | +| `InterstitialScene` | Interstitial | +| `RewardedScene` | Rewarded | +| `BannerScene`, `DualBanner` | Banner | +| `BannerRectTransformScene` | Banner attached to a RectTransform | +| `NativeScene`, `DualNative` | Native | diff --git a/AndroidIOS/VungleSDKSampleApp/.gitignore b/AndroidIOS/VungleSDKSampleApp/.gitignore new file mode 100644 index 0000000..c11ef25 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/.gitignore @@ -0,0 +1,132 @@ +# This .gitignore file should be placed at the root of your Unity project directory +# +# Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore +# +# Recommended: add any editor/OS/tool-specific ignore rules from the Global/ templates as needed. +# See: https://github.com/github/gitignore/tree/main/Global +# +.utmp/ +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Bb]uild/ +/[Bb]uilds/ +/[Ll]ogs/ +/[Uu]ser[Ss]ettings/ +*.log + +# By default unity supports Blender asset imports, *.blend1 blender files do not need to be commited to version control. +*.blend1 +*.blend1.meta + +# MemoryCaptures can get excessive in size. +# They also could contain extremely sensitive data +/[Mm]emoryCaptures/ + +# Recordings can get excessive in size +/[Rr]ecordings/ + +# Uncomment this line if you wish to ignore the asset store tools plugin +# /[Aa]ssets/AssetStoreTools* + +# Autogenerated Jetbrains Rider plugin +/[Aa]ssets/Plugins/Editor/JetBrains* +# Jetbrains Rider personal-layer settings +*.DotSettings.user + +# Visual Studio cache directory +.vs/ + +# Gradle cache directory +.gradle/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.slnx +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb +*.mdb +*.opendb +*.VC.db + +# Unity3D generated meta files +*.pidb.meta +*.pdb.meta +*.mdb.meta + +# Unity3D generated file on crash reports +sysinfo.txt + +# Mono auto generated files +mono_crash.* + +# Builds +*.apk +*.aab +*.unitypackage +*.unitypackage.meta +*.app + +# Crashlytics generated file +crashlytics-build.properties + +# TestRunner generated files +InitTestScene*.unity* + +# Addressables default ignores, before user customizations +/ServerData +/[Aa]ssets/StreamingAssets/aa* +/[Aa]ssets/AddressableAssetsData/link.xml* +/[Aa]ssets/Addressables_Temp* +# By default, Addressables content builds will generate addressables_content_state.bin +# files in platform-specific subfolders, for example: +# /Assets/AddressableAssetsData/OSX/addressables_content_state.bin +/[Aa]ssets/AddressableAssetsData/*/*.bin* + +# Visual Scripting auto-generated files +/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db +/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Flow/UnitOptions.db.meta +/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Core/Property Providers +/[Aa]ssets/Unity.VisualScripting.Generated/VisualScripting.Core/Property Providers.meta + +# Auto-generated scenes by play mode tests +/[Aa]ssets/[Ii]nit[Tt]est[Ss]cene*.unity* + +# Auto-generated cache in Assets folder +/[Aa]ssets/[Ss]ceneDependencyCache* + +# --- OS / editor rules (from github/gitignore Global templates) --- +# Note: the Linux template's `*~` pattern is intentionally omitted — it would +# match Unity's `Samples~`/`Documentation~` hidden-folder convention. + +# macOS +.DS_Store +.AppleDouble +.LSOverride +._* + +# Windows +Thumbs.db +ehthumbs.db +Desktop.ini +$RECYCLE.BIN/ + +# JetBrains IDEs +.idea/ + +# Visual Studio Code +.vscode/ + +# Local build tooling (not part of the sample) +/[Aa]ssets/Editor/ +/[Aa]ssets/Editor.meta diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Plugins.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins.meta new file mode 100644 index 0000000..ddc14da --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cbb920824d1654387bc3cd4626f5dbd7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android.meta new file mode 100644 index 0000000..b8b3330 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9ae6ce3d24b964af38bfd03d85903b51 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/gradleTemplate.properties b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/gradleTemplate.properties new file mode 100644 index 0000000..8704680 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/gradleTemplate.properties @@ -0,0 +1,8 @@ +org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M +org.gradle.parallel=true +unityStreamingAssets=**STREAMING_ASSETS** +# Android Resolver Properties Start +android.useAndroidX=true +android.enableJetifier=true +# Android Resolver Properties End +**ADDITIONAL_PROPERTIES** diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/gradleTemplate.properties.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/gradleTemplate.properties.meta new file mode 100644 index 0000000..1082e2a --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/gradleTemplate.properties.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c4325aa16258e4225955f19bd2312a50 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/mainTemplate.gradle b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/mainTemplate.gradle new file mode 100644 index 0000000..d0b7b27 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/mainTemplate.gradle @@ -0,0 +1,59 @@ +apply plugin: 'com.android.library' +apply from: '../shared/keepUnitySymbols.gradle' +apply from: '../shared/common.gradle' +**APPLY_PLUGINS** + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) +// Android Resolver Dependencies Start + implementation 'com.vungle:vungle-ads:[7.7,8.0)' // Packages/io.liftoff.vungleads/Editor/Vungle/VungleDependencies.xml:3 +// Android Resolver Dependencies End +**DEPS**} + +// Android Resolver Exclusions Start +android { + packaging { + exclude ('/lib/armeabi/*' + '*') + exclude ('/lib/armeabi-v7a/*' + '*') + exclude ('/lib/mips/*' + '*') + exclude ('/lib/mips64/*' + '*') + exclude ('/lib/x86/*' + '*') + exclude ('/lib/x86_64/*' + '*') + } +} +// Android Resolver Exclusions End +android { + namespace "com.unity3d.player" + ndkPath "**NDKPATH**" + ndkVersion "**NDKVERSION**" + compileSdk **APIVERSION** + buildToolsVersion "**BUILDTOOLS**" + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + + defaultConfig { + minSdk **MINSDK** + targetSdk **TARGETSDK** + ndk { + abiFilters **ABIFILTERS** + debugSymbolLevel **DEBUGSYMBOLLEVEL** + } + consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD** +**DEFAULT_CONFIG_SETUP** + } + + lint { + abortOnError false + } + + androidResources { + noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') + ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~" + }**PACKAGING** +} +**IL_CPP_BUILD_SETUP** +**SOURCE_BUILD_SETUP** +**EXTERNAL_SOURCES** diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/mainTemplate.gradle.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/mainTemplate.gradle.meta new file mode 100644 index 0000000..0a81c78 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/mainTemplate.gradle.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a43a0b28f018f4f968fb031c718332d3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/settingsTemplate.gradle b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/settingsTemplate.gradle new file mode 100644 index 0000000..0cc1dea --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/settingsTemplate.gradle @@ -0,0 +1,27 @@ +pluginManagement { + repositories { + **ARTIFACTORYREPOSITORY** + gradlePluginPortal() + google() + mavenCentral() + } +} + +include ':launcher', ':unityLibrary' +**INCLUDES** + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) + repositories { + **ARTIFACTORYREPOSITORY** + google() + mavenCentral() +// Android Resolver Repos Start + def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/") + mavenLocal() +// Android Resolver Repos End + flatDir { + dirs "${project(':unityLibrary').projectDir}/libs" + } + } +} diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/settingsTemplate.gradle.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/settingsTemplate.gradle.meta new file mode 100644 index 0000000..f712ef3 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Plugins/Android/settingsTemplate.gradle.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 52639013c5b7a43379d31ff3b26918cd +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples.meta new file mode 100644 index 0000000..ad28687 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7691c00a3b4d3403ebdf3331a39ee60c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes.meta new file mode 100644 index 0000000..420b2d1 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 63cce0f0075f34d64af636d09aa2aec6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerRectTransformScene.unity b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerRectTransformScene.unity new file mode 100644 index 0000000..3fe8476 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerRectTransformScene.unity @@ -0,0 +1,252 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &100000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 100000001} + - component: {fileID: 100000002} + - component: {fileID: 100000003} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &100000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &100000002 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &100000003 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 +--- !u!1 &200000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 200000001} + - component: {fileID: 200000002} + m_Layer: 0 + m_Name: BannerRectTransformController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &200000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &200000002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerRectTransformScene.unity.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerRectTransformScene.unity.meta new file mode 100644 index 0000000..38fbf51 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerRectTransformScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerScene.unity b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerScene.unity new file mode 100644 index 0000000..72edd23 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerScene.unity @@ -0,0 +1,252 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &100000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 100000001} + - component: {fileID: 100000002} + - component: {fileID: 100000003} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &100000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &100000002 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &100000003 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 +--- !u!1 &200000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 200000001} + - component: {fileID: 200000002} + m_Layer: 0 + m_Name: BannerController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &200000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &200000002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f1a2b3c4d5678901f1a2b3c4d5678901, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerScene.unity.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerScene.unity.meta new file mode 100644 index 0000000..e299817 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/BannerScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 44556677889900114455667788990011 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualBanner.unity b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualBanner.unity new file mode 100644 index 0000000..fa4fdb3 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualBanner.unity @@ -0,0 +1,252 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &100000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 100000001} + - component: {fileID: 100000002} + - component: {fileID: 100000003} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &100000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &100000002 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &100000003 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 +--- !u!1 &200000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 200000001} + - component: {fileID: 200000002} + m_Layer: 0 + m_Name: DualBannerController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &200000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &200000002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 975e0511299d74bf4bf61c5e25cb81d2, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualBanner.unity.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualBanner.unity.meta new file mode 100644 index 0000000..52a62b5 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualBanner.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 66778899001122336677889900112233 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualNative.unity b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualNative.unity new file mode 100644 index 0000000..4b8b066 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualNative.unity @@ -0,0 +1,252 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &100000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 100000001} + - component: {fileID: 100000002} + - component: {fileID: 100000003} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &100000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &100000002 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &100000003 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 +--- !u!1 &200000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 200000001} + - component: {fileID: 200000002} + m_Layer: 0 + m_Name: DualNativeController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &200000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &200000002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: db21d1fdfa27541e79628a45ad7335ed, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualNative.unity.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualNative.unity.meta new file mode 100644 index 0000000..86e9d92 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/DualNative.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 77889900112233447788990011223344 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/InterstitialScene.unity b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/InterstitialScene.unity new file mode 100644 index 0000000..2689a36 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/InterstitialScene.unity @@ -0,0 +1,252 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &100000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 100000001} + - component: {fileID: 100000002} + - component: {fileID: 100000003} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &100000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &100000002 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &100000003 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 +--- !u!1 &200000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 200000001} + - component: {fileID: 200000002} + m_Layer: 0 + m_Name: InterstitialController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &200000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &200000002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d1e2f3a4b5678901d1e2f3a4b5678901, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/InterstitialScene.unity.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/InterstitialScene.unity.meta new file mode 100644 index 0000000..418e0e5 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/InterstitialScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 22334455667788992233445566778899 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/LaunchScene.unity b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/LaunchScene.unity new file mode 100644 index 0000000..6f7df46 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/LaunchScene.unity @@ -0,0 +1,252 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &100000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 100000001} + - component: {fileID: 100000002} + - component: {fileID: 100000003} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &100000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &100000002 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &100000003 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 +--- !u!1 &200000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 200000001} + - component: {fileID: 200000002} + m_Layer: 0 + m_Name: LaunchController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &200000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &200000002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c1d2e3f4a5678901c1d2e3f4a5678901, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/LaunchScene.unity.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/LaunchScene.unity.meta new file mode 100644 index 0000000..3170b6a --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/LaunchScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 11223344556677881122334455667788 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/NativeScene.unity b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/NativeScene.unity new file mode 100644 index 0000000..57dec48 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/NativeScene.unity @@ -0,0 +1,252 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &100000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 100000001} + - component: {fileID: 100000002} + - component: {fileID: 100000003} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &100000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &100000002 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &100000003 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 +--- !u!1 &200000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 200000001} + - component: {fileID: 200000002} + m_Layer: 0 + m_Name: NativeController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &200000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &200000002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/NativeScene.unity.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/NativeScene.unity.meta new file mode 100644 index 0000000..1285b82 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/NativeScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 55667788990011225566778899001122 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/RewardedScene.unity b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/RewardedScene.unity new file mode 100644 index 0000000..b71b2dd --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/RewardedScene.unity @@ -0,0 +1,252 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &100000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 100000001} + - component: {fileID: 100000002} + - component: {fileID: 100000003} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &100000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &100000002 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!81 &100000003 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 100000000} + m_Enabled: 1 +--- !u!1 &200000000 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 200000001} + - component: {fileID: 200000002} + m_Layer: 0 + m_Name: RewardedController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &200000001 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &200000002 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 200000000} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e1f2a3b4c5678901e1f2a3b4c5678901, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/RewardedScene.unity.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/RewardedScene.unity.meta new file mode 100644 index 0000000..e1aad37 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scenes/RewardedScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 33445566778899003344556677889900 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts.meta new file mode 100644 index 0000000..b130766 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d065ef4a352dd45748f13fe599a7f9e6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerController.cs b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerController.cs new file mode 100644 index 0000000..6615716 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerController.cs @@ -0,0 +1,292 @@ +using System.Collections; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.SceneManagement; +using TMPro; +using VungleAds; + +namespace VungleAds.Samples +{ + public class BannerController : MonoBehaviour + { + TMP_Text logText; + ScrollRect logScroll; + bool logDirty; + int selectedSizeIndex; + int selectedPositionIndex; + Button[] sizeButtons; + Button[] positionButtons; + GameObject customSizeRow; + TMP_InputField widthInput, heightInput; + LayoutElement bannerSpacer; + + static readonly Color SelectedColor = new Color(0.2f, 0.55f, 0.95f); + static readonly Color UnselectedColor = new Color(0.27f, 0.27f, 0.32f); + static readonly Color BackColor = new Color(0.38f, 0.38f, 0.43f); + + readonly string[] sizeLabels = { + "Banner (320x50)", + "Banner Short (300x50)", + "Leaderboard (728x90)", + "MREC (300x250)", + "Inline (Custom)" + }; + + readonly string[] positionLabels = { "Top", "Center", "Bottom" }; + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + VungleBannerView bannerAd; + #endif + + void Start() + { + var content = UIHelper.SetupScene(); + + UIHelper.CreateBackButton(content, OnBack); + UIHelper.CreateTitle("Banner", content); + + UIHelper.CreateLabel("Select Size:", content, 24, FontStyles.Bold, + TextAlignmentOptions.MidlineLeft, 35); + + sizeButtons = new Button[sizeLabels.Length]; + for (int i = 0; i < sizeLabels.Length; i++) + { + int idx = i; + sizeButtons[i] = UIHelper.CreateButton(sizeLabels[i], content, + () => SelectSize(idx), 50, UnselectedColor); + } + + var hGroup = UIHelper.CreateHorizontalGroup(content, 50); + customSizeRow = hGroup.parent.gameObject; + + UIHelper.CreateLabel("W:", hGroup, 22, FontStyles.Normal, TextAlignmentOptions.MidlineRight, 35); + widthInput = UIHelper.CreateInputField("320", hGroup, 35); + widthInput.text = "320"; + UIHelper.CreateLabel("H:", hGroup, 22, FontStyles.Normal, TextAlignmentOptions.MidlineRight, 35); + heightInput = UIHelper.CreateInputField("100", hGroup, 35); + heightInput.text = "100"; + + UIHelper.CreateSpacer(content, 4); + UIHelper.CreateLabel("Position:", content, 24, FontStyles.Bold, + TextAlignmentOptions.MidlineLeft, 35); + + positionButtons = new Button[positionLabels.Length]; + var posRow = UIHelper.CreateHorizontalGroup(content, 50); + for (int i = 0; i < positionLabels.Length; i++) + { + int idx = i; + positionButtons[i] = UIHelper.CreateButton(positionLabels[i], posRow, + () => SelectPosition(idx), 35, UnselectedColor); + } + + UIHelper.CreateSpacer(content, 4); + UIHelper.CreateButton("Load", content, OnLoad); + UIHelper.CreateButton("Attach", content, OnAttach); + UIHelper.CreateButton("Destroy", content, DestroyBanner); + + UIHelper.CreateSpacer(content, 4); + UIHelper.CreateLabel("Log", content, 22, FontStyles.Bold); + var (lt, sr) = UIHelper.CreateLogArea(content); + logText = lt; + logScroll = sr; + UIHelper.CreateButton("Clear Log", content, () => VungleTestManager.Instance.ClearLog(), + 50, BackColor); + + var spacerObj = new GameObject("BannerSpacer"); + spacerObj.transform.SetParent(content, false); + bannerSpacer = spacerObj.AddComponent(); + + SelectSize(0); + SelectPosition(2); + + VungleTestManager.Instance.OnLogChanged += MarkLogDirty; + logDirty = true; + } + + void OnDestroy() + { + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + bannerAd?.Destroy(); + bannerAd = null; + #endif + if (VungleTestManager.HasInstance) + VungleTestManager.Instance.OnLogChanged -= MarkLogDirty; + } + + void MarkLogDirty() => logDirty = true; + + void Update() + { + if (logDirty) + { + logDirty = false; + logText.text = VungleTestManager.Instance.LogText; + StartCoroutine(ScrollToBottom()); + } + } + + IEnumerator ScrollToBottom() + { + yield return null; + logScroll.verticalNormalizedPosition = 0f; + } + + void SelectSize(int index) + { + selectedSizeIndex = index; + for (int i = 0; i < sizeButtons.Length; i++) + { + var img = sizeButtons[i].GetComponent(); + img.color = i == index ? SelectedColor : UnselectedColor; + } + customSizeRow.SetActive(index == 4); + } + + void SelectPosition(int index) + { + selectedPositionIndex = index; + for (int i = 0; i < positionButtons.Length; i++) + { + var img = positionButtons[i].GetComponent(); + img.color = i == index ? SelectedColor : UnselectedColor; + } + } + + void Log(string msg) => VungleTestManager.Instance.Log(msg); + + void OnBack() + { + Log("Back tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + bannerAd?.Destroy(); + bannerAd = null; + #endif + SceneManager.LoadScene("LaunchScene"); + } + + void OnLoad() + { + Log("Load tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + bannerAd?.Destroy(); + bannerAd = null; + + if (selectedSizeIndex == 4) + { + int w = 320, h = 100; + int.TryParse(widthInput.text, out w); + int.TryParse(heightInput.text, out h); + bannerAd = new VungleBannerView(VungleConstants.InlinePlacementId, w, h); + Log($"Banner loading (inline {w}x{h})..."); + } + else if (selectedSizeIndex == 3) + { + bannerAd = new VungleBannerView(VungleConstants.MrecPlacementId, VungleBannerSize.Mrec); + Log($"Banner loading ({sizeLabels[selectedSizeIndex]})..."); + } + else + { + VungleBannerSize[] sizes = { + VungleBannerSize.Banner, + VungleBannerSize.BannerShort, + VungleBannerSize.BannerLeaderboard + }; + bannerAd = new VungleBannerView(VungleConstants.BannerPlacementId, sizes[selectedSizeIndex]); + Log($"Banner loading ({sizeLabels[selectedSizeIndex]})..."); + } + + bannerAd.onLoadSuccess += () => + { + Log("Banner loaded"); + bannerAd.Attach(0, -10000, 1, 1); + }; + bannerAd.onLoadFailed += (err) => Log("Banner load failed: " + err); + bannerAd.onDidPresent += () => Log("Banner presented"); + bannerAd.onPresentFailed += (err) => Log("Banner present failed: " + err); + bannerAd.onDidClose += () => { Log("Banner closed"); bannerAd = null; }; + bannerAd.onImpression += () => Log("Banner impression"); + bannerAd.onClick += () => Log("Banner click"); + bannerAd.Load(); + #else + Log("Banner not supported in editor"); + #endif + } + + void OnAttach() + { + Log("Attach tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + if (bannerAd != null) + { + int bannerPxH = GetBannerPixelHeight(); + int y; + switch (selectedPositionIndex) + { + case 0: y = 0; break; + case 1: y = (Screen.height - bannerPxH) / 2; break; + default: y = Screen.height - bannerPxH; break; + } + + int bannerPxW = GetBannerPixelWidth(); + int x = (Screen.width - bannerPxW) / 2; + bannerAd.Attach(x, y, bannerPxW, bannerPxH); + Log($"Banner attached at ({x}, {y}) - {positionLabels[selectedPositionIndex]}"); + + if (selectedPositionIndex == 2) + { + float canvasScale = logText.canvas != null ? logText.canvas.scaleFactor : 1f; + bannerSpacer.minHeight = bannerPxH / canvasScale + 10; + bannerSpacer.preferredHeight = bannerSpacer.minHeight; + } + else + { + bannerSpacer.minHeight = 0; + bannerSpacer.preferredHeight = 0; + } + } + else + { + Log("Banner not loaded"); + } + #else + Log("Banner not supported in editor"); + #endif + } + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + int GetBannerPixelHeight() + { + int[] dpHeights = { 50, 50, 90, 250, 100 }; + int dpH = selectedSizeIndex == 4 + ? (int.TryParse(heightInput.text, out int h) ? h : 100) + : dpHeights[selectedSizeIndex]; + float density = Screen.dpi > 0 ? Screen.dpi / 160f : 2f; + return (int)(dpH * density); + } + + int GetBannerPixelWidth() + { + int[] dpWidths = { 320, 300, 728, 300, 320 }; + int dpW = selectedSizeIndex == 4 + ? (int.TryParse(widthInput.text, out int w) ? w : 320) + : dpWidths[selectedSizeIndex]; + float density = Screen.dpi > 0 ? Screen.dpi / 160f : 2f; + return (int)(dpW * density); + } + #endif + + void DestroyBanner() + { + Log("Destroy tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + bannerAd?.Destroy(); + bannerAd = null; + Log("Banner destroyed"); + #else + Log("Banner not supported in editor"); + #endif + bannerSpacer.minHeight = 0; + bannerSpacer.preferredHeight = 0; + } + } +} diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerController.cs.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerController.cs.meta new file mode 100644 index 0000000..6c9826e --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f1a2b3c4d5678901f1a2b3c4d5678901 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerRectTransformController.cs b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerRectTransformController.cs new file mode 100644 index 0000000..669fab3 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerRectTransformController.cs @@ -0,0 +1,217 @@ +using System.Collections; +using System.Runtime.InteropServices; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.SceneManagement; +using TMPro; +using VungleAds; + +namespace VungleAds.Samples +{ + public class BannerRectTransformController : MonoBehaviour + { + TMP_Text logText; + ScrollRect logScroll; + bool logDirty; + RectTransform adSlot; + + #if UNITY_IOS && !UNITY_EDITOR + [DllImport("__Internal")] + private static extern float VungleGetNativeScreenScale(); + #endif + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + VungleBannerView bannerAd; + #endif + + void Start() + { + var content = UIHelper.SetupScene(); + + UIHelper.CreateBackButton(content, OnBack); + UIHelper.CreateTitle("Banner (RectTransform)", content); + UIHelper.CreateSpacer(content, 8); + + UIHelper.CreateButton("Load", content, OnLoad); + UIHelper.CreateButton("Attach to Slot", content, OnAttach); + UIHelper.CreateButton("Destroy", content, OnDestroyBanner); + + UIHelper.CreateSpacer(content, 12); + + adSlot = CreateAdSlot(content); + + UIHelper.CreateSpacer(content, 12); + UIHelper.CreateLabel("Log", content, 22, FontStyles.Bold); + var (lt, sr) = UIHelper.CreateLogArea(content); + logText = lt; + logScroll = sr; + UIHelper.CreateButton("Clear Log", content, () => VungleTestManager.Instance.ClearLog(), + 50, new Color(0.38f, 0.38f, 0.43f)); + + VungleTestManager.Instance.OnLogChanged += MarkLogDirty; + logDirty = true; + } + + RectTransform CreateAdSlot(Transform parent) + { + // Compute canvas units so the native view renders at exactly 300×250 dp/pt. + // iOS bridge does: frame = screenPixels / [UIScreen mainScreen].scale + // Android bridge uses raw screen pixels with DisplayMetrics.density. + // Both require the exact native scale, not an approximation from Screen.dpi. + // + // canvas.scaleFactor is NOT used here because CanvasScaler.Update() hasn't run yet + // in Start() — it fires with default settings (scaleFactor=1) on AddComponent, then + // corrects itself in the first Update(). Recompute using the same formula directly. + float logScaleX = Mathf.Log(Screen.width / 1080f, 2f); + float logScaleY = Mathf.Log(Screen.height / 1920f, 2f); + float canvasScale = Mathf.Pow(2f, Mathf.Lerp(logScaleX, logScaleY, 0.5f)); + + float nativeScale; + #if UNITY_IOS && !UNITY_EDITOR + nativeScale = VungleGetNativeScreenScale(); + #elif UNITY_ANDROID && !UNITY_EDITOR + using (var player = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) + using (var activity = player.GetStatic("currentActivity")) + using (var resources = activity.Call("getResources")) + using (var metrics = resources.Call("getDisplayMetrics")) + nativeScale = metrics.Get("density"); + #else + nativeScale = Screen.dpi > 0 ? Screen.dpi / 160f : 1f; + #endif + + float slotW = 300f * nativeScale / canvasScale; + float slotH = 250f * nativeScale / canvasScale; + + // Full-width container fixes height + var container = new GameObject("AdSlotContainer"); + container.transform.SetParent(parent, false); + var containerLE = container.AddComponent(); + containerLE.minHeight = slotH; + containerLE.preferredHeight = slotH; + + // Inner slot: MREC dimensions centered in container + var slotObj = new GameObject("AdSlot", typeof(RectTransform)); + slotObj.transform.SetParent(container.transform, false); + var slotRT = (RectTransform)slotObj.transform; + slotRT.anchorMin = new Vector2(0.5f, 0.5f); + slotRT.anchorMax = new Vector2(0.5f, 0.5f); + slotRT.anchoredPosition = Vector2.zero; + slotRT.sizeDelta = new Vector2(slotW, slotH); + + slotObj.AddComponent().color = new Color(0.18f, 0.32f, 0.22f); + + var outline = slotObj.AddComponent(); + outline.effectColor = new Color(0.3f, 0.7f, 0.4f, 0.8f); + outline.effectDistance = new Vector2(3, 3); + + var labelObj = new GameObject("Label", typeof(RectTransform)); + labelObj.transform.SetParent(slotObj.transform, false); + var labelRT = (RectTransform)labelObj.transform; + labelRT.anchorMin = Vector2.zero; + labelRT.anchorMax = Vector2.one; + labelRT.offsetMin = Vector2.zero; + labelRT.offsetMax = Vector2.zero; + var label = labelObj.AddComponent(); + label.text = "Ad Slot (MREC 300×250)"; + label.fontSize = 28; + label.fontStyle = FontStyles.Bold; + label.color = new Color(1f, 1f, 1f, 0.35f); + label.alignment = TextAlignmentOptions.Center; + + return slotRT; + } + + void OnDestroy() + { + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + bannerAd?.Destroy(); + bannerAd = null; + #endif + if (VungleTestManager.HasInstance) + VungleTestManager.Instance.OnLogChanged -= MarkLogDirty; + } + + void MarkLogDirty() => logDirty = true; + + void Update() + { + if (logDirty) + { + logDirty = false; + logText.text = VungleTestManager.Instance.LogText; + StartCoroutine(ScrollToBottom()); + } + } + + IEnumerator ScrollToBottom() + { + yield return null; + logScroll.verticalNormalizedPosition = 0f; + } + + void Log(string msg) => VungleTestManager.Instance.Log(msg); + + void OnBack() + { + Log("Back tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + bannerAd?.Destroy(); + bannerAd = null; + #endif + SceneManager.LoadScene("LaunchScene"); + } + + void OnLoad() + { + Log("Load tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + bannerAd?.Destroy(); + bannerAd = null; + + bannerAd = new VungleBannerView(VungleConstants.MrecPlacementId, VungleBannerSize.Mrec); + bannerAd.onLoadSuccess = () => Log("Banner loaded — tap Attach to Slot"); + bannerAd.onLoadFailed = err => Log("Banner load failed: " + err); + bannerAd.onWillPresent = () => Log("Banner will present"); + bannerAd.onDidPresent = () => Log("Banner presented"); + bannerAd.onPresentFailed = err => Log("Banner present failed: " + err); + bannerAd.onImpression = () => Log("Banner impression"); + bannerAd.onClick = () => Log("Banner click"); + bannerAd.onWillLeaveApplication = () => Log("Leaving app via ad"); + bannerAd.onWillClose = () => Log("Banner will close"); + bannerAd.onDidClose = () => { Log("Banner closed"); bannerAd = null; }; + bannerAd.Load(); + Log("Banner loading (MREC)..."); + #else + Log("Banner not supported in editor"); + #endif + } + + void OnAttach() + { + Log("Attach tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + if (bannerAd == null) + { + Log("No banner loaded"); + return; + } + bannerAd.Attach(adSlot); + Log("Banner attached to RectTransform slot"); + #else + Log("Banner not supported in editor"); + #endif + } + + void OnDestroyBanner() + { + Log("Destroy tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + bannerAd?.Destroy(); + bannerAd = null; + Log("Banner destroyed"); + #else + Log("Banner not supported in editor"); + #endif + } + } +} diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerRectTransformController.cs.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerRectTransformController.cs.meta new file mode 100644 index 0000000..d70f96b --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/BannerRectTransformController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualBannerController.cs b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualBannerController.cs new file mode 100644 index 0000000..3cc3b54 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualBannerController.cs @@ -0,0 +1,210 @@ +using System.Collections; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.SceneManagement; +using TMPro; +using VungleAds; + +namespace VungleAds.Samples +{ + public class DualBannerController : MonoBehaviour + { + TMP_Text logText; + ScrollRect logScroll; + bool logDirty; + LayoutElement topSpacer, bottomSpacer; + + static readonly Color BackColor = new Color(0.38f, 0.38f, 0.43f); + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + VungleBannerView topBanner, bottomBanner; + #endif + + void Start() + { + var content = UIHelper.SetupScene(); + + var topSpacerObj = new GameObject("TopBannerSpacer"); + topSpacerObj.transform.SetParent(content, false); + topSpacer = topSpacerObj.AddComponent(); + + UIHelper.CreateBackButton(content, OnBack); + UIHelper.CreateTitle("Dual Banner", content); + UIHelper.CreateSpacer(content, 8); + + UIHelper.CreateButton("Load Both", content, OnLoadBoth); + UIHelper.CreateButton("Attach Both", content, OnAttachBoth); + UIHelper.CreateButton("Destroy Both", content, OnDestroyBoth); + + UIHelper.CreateSpacer(content, 8); + UIHelper.CreateLabel("Log", content, 22, FontStyles.Bold); + var (lt, sr) = UIHelper.CreateLogArea(content); + logText = lt; + logScroll = sr; + UIHelper.CreateButton("Clear Log", content, () => VungleTestManager.Instance.ClearLog(), + 50, BackColor); + + var bottomSpacerObj = new GameObject("BottomBannerSpacer"); + bottomSpacerObj.transform.SetParent(content, false); + bottomSpacer = bottomSpacerObj.AddComponent(); + + VungleTestManager.Instance.OnLogChanged += MarkLogDirty; + logDirty = true; + } + + void OnDestroy() + { + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + topBanner?.Destroy(); + topBanner = null; + bottomBanner?.Destroy(); + bottomBanner = null; + #endif + if (VungleTestManager.HasInstance) + VungleTestManager.Instance.OnLogChanged -= MarkLogDirty; + } + + void MarkLogDirty() => logDirty = true; + + void Update() + { + if (logDirty) + { + logDirty = false; + logText.text = VungleTestManager.Instance.LogText; + StartCoroutine(ScrollToBottom()); + } + } + + IEnumerator ScrollToBottom() + { + yield return null; + logScroll.verticalNormalizedPosition = 0f; + } + + void Log(string msg) => VungleTestManager.Instance.Log(msg); + + void OnBack() + { + Log("Back tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + topBanner?.Destroy(); + topBanner = null; + bottomBanner?.Destroy(); + bottomBanner = null; + #endif + SceneManager.LoadScene("LaunchScene"); + } + + void OnLoadBoth() + { + Log("Load Both tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + topBanner?.Destroy(); + bottomBanner?.Destroy(); + + string placementId = VungleConstants.BannerPlacementId; + + topBanner = new VungleBannerView(placementId, VungleBannerSize.Banner); + topBanner.onLoadSuccess += () => + { + Log("Top banner loaded"); + topBanner.Attach(0, -10000, 1, 1); + }; + topBanner.onLoadFailed += (err) => Log("Top banner load failed: " + err); + topBanner.onDidPresent += () => Log("Top banner presented"); + topBanner.onImpression += () => Log("Top banner impression"); + topBanner.onClick += () => Log("Top banner click"); + topBanner.onDidClose += () => { Log("Top banner closed"); topBanner = null; }; + topBanner.Load(); + Log("Top banner loading..."); + + bottomBanner = new VungleBannerView(placementId, VungleBannerSize.Banner); + bottomBanner.onLoadSuccess += () => + { + Log("Bottom banner loaded"); + bottomBanner.Attach(0, -10000, 1, 1); + }; + bottomBanner.onLoadFailed += (err) => Log("Bottom banner load failed: " + err); + bottomBanner.onDidPresent += () => Log("Bottom banner presented"); + bottomBanner.onImpression += () => Log("Bottom banner impression"); + bottomBanner.onClick += () => Log("Bottom banner click"); + bottomBanner.onDidClose += () => { Log("Bottom banner closed"); bottomBanner = null; }; + bottomBanner.Load(); + Log("Bottom banner loading..."); + #else + Log("Banner not supported in editor"); + #endif + } + + void OnAttachBoth() + { + Log("Attach Both tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + int bannerPxH = GetBannerPixelHeight(); + int bannerPxW = GetBannerPixelWidth(); + int x = (Screen.width - bannerPxW) / 2; + float canvasScale = logText.canvas != null ? logText.canvas.scaleFactor : 1f; + + if (topBanner != null) + { + topBanner.Attach(x, 0, bannerPxW, bannerPxH); + Log("Top banner attached at y=0"); + topSpacer.minHeight = bannerPxH / canvasScale + 10; + topSpacer.preferredHeight = topSpacer.minHeight; + } + else + { + Log("Top banner not loaded"); + } + + if (bottomBanner != null) + { + int y = Screen.height - bannerPxH; + bottomBanner.Attach(x, y, bannerPxW, bannerPxH); + Log($"Bottom banner attached at y={y}"); + bottomSpacer.minHeight = bannerPxH / canvasScale + 10; + bottomSpacer.preferredHeight = bottomSpacer.minHeight; + } + else + { + Log("Bottom banner not loaded"); + } + #else + Log("Banner not supported in editor"); + #endif + } + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + int GetBannerPixelHeight() + { + float density = Screen.dpi > 0 ? Screen.dpi / 160f : 2f; + return (int)(50 * density); + } + + int GetBannerPixelWidth() + { + float density = Screen.dpi > 0 ? Screen.dpi / 160f : 2f; + return (int)(320 * density); + } + #endif + + void OnDestroyBoth() + { + Log("Destroy Both tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + topBanner?.Destroy(); + topBanner = null; + bottomBanner?.Destroy(); + bottomBanner = null; + Log("Both banners destroyed"); + #else + Log("Banner not supported in editor"); + #endif + topSpacer.minHeight = 0; + topSpacer.preferredHeight = 0; + bottomSpacer.minHeight = 0; + bottomSpacer.preferredHeight = 0; + } + } +} diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualBannerController.cs.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualBannerController.cs.meta new file mode 100644 index 0000000..5553297 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualBannerController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 975e0511299d74bf4bf61c5e25cb81d2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualNativeController.cs b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualNativeController.cs new file mode 100644 index 0000000..5988e30 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualNativeController.cs @@ -0,0 +1,383 @@ +using System.Collections; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.SceneManagement; +using TMPro; +using VungleAds; + +namespace VungleAds.Samples +{ + public class DualNativeController : MonoBehaviour + { + TMP_Text logText; + ScrollRect logScroll; + bool logDirty; + + // Top ad card + TMP_Text topTitle, topRating, topBody, topCta; + RawImage topIcon; + RectTransform topMediaSlot; + + // Bottom ad card + TMP_Text bottomTitle, bottomRating, bottomBody, bottomCta; + RawImage bottomIcon; + RectTransform bottomMediaSlot; + + static readonly Color BackColor = new Color(0.38f, 0.38f, 0.43f); + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + VungleNative topNative, bottomNative; + #endif + + void Start() + { + var content = UIHelper.SetupScene(); + + UIHelper.CreateBackButton(content, OnBack); + UIHelper.CreateTitle("Dual Native", content); + UIHelper.CreateSpacer(content, 8); + + UIHelper.CreateButton("Load Both", content, OnLoadBoth); + UIHelper.CreateButton("Attach Both", content, OnAttachBoth); + UIHelper.CreateButton("Detach Both", content, OnDetachBoth); + + UIHelper.CreateSpacer(content, 8); + + // Top ad card + UIHelper.CreateLabel("Top Ad", content, 22, FontStyles.Bold, + TextAlignmentOptions.MidlineLeft, 30); + CreateAdCard(content, out topIcon, out topTitle, out topRating, + out topMediaSlot, out topBody, out topCta, 300); + + UIHelper.CreateSpacer(content, 8); + + // Bottom ad card + UIHelper.CreateLabel("Bottom Ad", content, 22, FontStyles.Bold, + TextAlignmentOptions.MidlineLeft, 30); + CreateAdCard(content, out bottomIcon, out bottomTitle, out bottomRating, + out bottomMediaSlot, out bottomBody, out bottomCta, 300); + + UIHelper.CreateSpacer(content, 8); + UIHelper.CreateLabel("Log", content, 22, FontStyles.Bold); + var (lt, sr) = UIHelper.CreateLogArea(content); + logText = lt; + logScroll = sr; + UIHelper.CreateButton("Clear Log", content, () => VungleTestManager.Instance.ClearLog(), + 50, BackColor); + + VungleTestManager.Instance.OnLogChanged += MarkLogDirty; + logDirty = true; + } + + void CreateAdCard(Transform parent, out RawImage icon, out TMP_Text title, + out TMP_Text rating, out RectTransform media, out TMP_Text body, + out TMP_Text cta, float mediaHeight) + { + // Header row: icon + title/rating + var row = UIHelper.CreateHorizontalGroup(parent, 80, 12); + + var iconFrame = new GameObject("IconFrame"); + iconFrame.transform.SetParent(row, false); + var iconLE = iconFrame.AddComponent(); + iconLE.minWidth = 80; + iconLE.preferredWidth = 80; + iconLE.flexibleWidth = 0; + + var iconObj = new GameObject("Icon", typeof(RectTransform)); + iconObj.transform.SetParent(iconFrame.transform, false); + var iconRT = (RectTransform)iconObj.transform; + iconRT.anchorMin = Vector2.zero; + iconRT.anchorMax = Vector2.one; + iconRT.offsetMin = Vector2.zero; + iconRT.offsetMax = Vector2.zero; + icon = iconObj.AddComponent(); + icon.color = new Color(0.2f, 0.2f, 0.25f); + var iconFitter = iconObj.AddComponent(); + iconFitter.aspectMode = AspectRatioFitter.AspectMode.FitInParent; + iconFitter.aspectRatio = 1f; + + var textCol = new GameObject("InfoCol"); + textCol.transform.SetParent(row, false); + var textLE = textCol.AddComponent(); + textLE.flexibleWidth = 1; + var vlg = textCol.AddComponent(); + vlg.childForceExpandHeight = true; + vlg.childControlHeight = true; + vlg.childForceExpandWidth = true; + vlg.childControlWidth = true; + vlg.spacing = 2; + vlg.childAlignment = TextAnchor.MiddleLeft; + + title = AddText("--", textCol.transform, 24, FontStyles.Bold, Color.white); + rating = AddText("Rating: --", textCol.transform, 16, FontStyles.Normal, + new Color(0.7f, 0.7f, 0.7f)); + + // Media slot + var slotObj = new GameObject("MediaSlot"); + slotObj.transform.SetParent(parent, false); + var slotLE = slotObj.AddComponent(); + slotLE.minHeight = mediaHeight; + slotLE.preferredHeight = mediaHeight; + slotObj.AddComponent().color = new Color(0.15f, 0.15f, 0.2f); + media = (RectTransform)slotObj.transform; + + // Body + body = UIHelper.CreateLabel("", parent, 20, FontStyles.Normal, + TextAlignmentOptions.MidlineLeft, 35); + + // CTA + cta = CreateCtaButton(parent); + } + + TMP_Text CreateCtaButton(Transform parent) + { + var row = new GameObject("CtaRow", typeof(RectTransform)); + row.transform.SetParent(parent, false); + var rowLE = row.AddComponent(); + rowLE.minHeight = 50; + rowLE.preferredHeight = 50; + + var btnObj = new GameObject("CtaBtn", typeof(RectTransform)); + btnObj.transform.SetParent(row.transform, false); + var btnRT = (RectTransform)btnObj.transform; + btnRT.anchorMin = new Vector2(0, 0); + btnRT.anchorMax = new Vector2(0, 1); + btnRT.pivot = new Vector2(0, 0.5f); + btnRT.sizeDelta = new Vector2(200, 0); + btnRT.anchoredPosition = Vector2.zero; + btnObj.AddComponent().color = new Color(0.18f, 0.72f, 0.33f); + + var textObj = new GameObject("Text", typeof(RectTransform)); + textObj.transform.SetParent(btnObj.transform, false); + var textRT = (RectTransform)textObj.transform; + textRT.anchorMin = Vector2.zero; + textRT.anchorMax = Vector2.one; + textRT.offsetMin = Vector2.zero; + textRT.offsetMax = Vector2.zero; + + var label = textObj.AddComponent(); + label.text = ""; + label.fontSize = 20; + label.fontStyle = FontStyles.Bold; + label.color = Color.white; + label.alignment = TextAlignmentOptions.Center; + return label; + } + + TMP_Text AddText(string text, Transform parent, float fontSize, FontStyles style, Color color) + { + var obj = new GameObject("Text"); + obj.transform.SetParent(parent, false); + var t = obj.AddComponent(); + t.text = text; + t.fontSize = fontSize; + t.fontStyle = style; + t.color = color; + t.alignment = TextAlignmentOptions.MidlineLeft; + return t; + } + + void OnDestroy() + { + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + topNative?.Destroy(); + topNative = null; + bottomNative?.Destroy(); + bottomNative = null; + #endif + if (VungleTestManager.HasInstance) + VungleTestManager.Instance.OnLogChanged -= MarkLogDirty; + } + + void MarkLogDirty() => logDirty = true; + + void Update() + { + if (logDirty) + { + logDirty = false; + logText.text = VungleTestManager.Instance.LogText; + StartCoroutine(ScrollToBottom()); + } + } + + IEnumerator ScrollToBottom() + { + yield return null; + logScroll.verticalNormalizedPosition = 0f; + } + + void Log(string msg) => VungleTestManager.Instance.Log(msg); + + void OnBack() + { + Log("Back tapped"); + SceneManager.LoadScene("LaunchScene"); + } + + // Attaches the native container over the whole ad card (header through + // CTA) with every element clickable — a single clickable rect covering + // the card. The MediaView is laid out over the media slot inside it. + void AttachToSlot(VungleNative native, RectTransform mediaSlot, + RawImage icon, TMP_Text cta, string label) + { + if (native == null) + { + Log($"{label} not loaded"); + return; + } + + Canvas canvas = mediaSlot.GetComponentInParent(); + Camera cam = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : canvas.worldCamera; + + // Card bounds: header row (Icon -> IconFrame -> row) through + // CTA row (Text -> CtaBtn -> CtaRow) + var headerRow = (RectTransform)icon.transform.parent.parent; + var ctaRow = (RectTransform)cta.transform.parent.parent; + + var (mediaMin, mediaMax) = GetScreenRect(mediaSlot, cam); + var (topMin, topMax) = GetScreenRect(headerRow, cam); + var (bottomMin, bottomMax) = GetScreenRect(ctaRow, cam); + + Vector2 cardMin = Vector2.Min(Vector2.Min(topMin, bottomMin), mediaMin); + Vector2 cardMax = Vector2.Max(Vector2.Max(topMax, bottomMax), mediaMax); + + int x = (int)cardMin.x; + int y = (int)(Screen.height - cardMax.y); + int w = (int)(cardMax.x - cardMin.x); + int h = (int)(cardMax.y - cardMin.y); + int mx = (int)mediaMin.x; + int my = (int)(Screen.height - mediaMax.y); + int mw = (int)(mediaMax.x - mediaMin.x); + int mh = (int)(mediaMax.y - mediaMin.y); + + // One rect covering the whole card = everything clickable + var clickableRects = new[] { new RectInt(x, y, w, h) }; + + native.Attach(x, y, w, h, mx, my, mw, mh, clickableRects); + Log($"{label} attached at ({x},{y} {w}x{h}), whole card clickable"); + } + + (Vector2 min, Vector2 max) GetScreenRect(RectTransform rt, Camera cam) + { + Vector3[] corners = new Vector3[4]; + rt.GetWorldCorners(corners); + Vector2 min = RectTransformUtility.WorldToScreenPoint(cam, corners[0]); + Vector2 max = RectTransformUtility.WorldToScreenPoint(cam, corners[2]); + return (min, max); + } + + void ShowAdDisplay(VungleNative native, TMP_Text titleL, TMP_Text ratingL, + TMP_Text bodyL, TMP_Text ctaL, RawImage iconImg) + { + titleL.text = string.IsNullOrEmpty(native.AdTitle) ? "--" : native.AdTitle; + ratingL.text = "Rating: " + (native.AdStarRating > 0 ? native.AdStarRating.ToString("F1") : "0.0"); + bodyL.text = string.IsNullOrEmpty(native.AdBody) ? "" : native.AdBody; + ctaL.text = string.IsNullOrEmpty(native.AdCallToAction) ? "" : native.AdCallToAction; + if (!string.IsNullOrEmpty(native.AdIconUrl)) + StartCoroutine(LoadIcon(native.AdIconUrl, iconImg)); + } + + IEnumerator LoadIcon(string url, RawImage target) + { + yield return UIHelper.LoadImageFromPath(url, target); + if (target.texture != null) + { + var fitter = target.GetComponent(); + if (fitter != null) + fitter.aspectRatio = (float)target.texture.width / target.texture.height; + } + } + + void ClearAdDisplay(TMP_Text titleL, TMP_Text ratingL, TMP_Text bodyL, + TMP_Text ctaL, RawImage iconImg) + { + titleL.text = "--"; + ratingL.text = "Rating: --"; + bodyL.text = ""; + ctaL.text = ""; + iconImg.texture = null; + iconImg.color = new Color(0.2f, 0.2f, 0.25f); + var fitter = iconImg.GetComponent(); + if (fitter != null) fitter.aspectRatio = 1f; + } + + void OnAttachBoth() + { + Log("Attach Both tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + if (topNative != null && topNative.CanPlay()) + { + AttachToSlot(topNative, topMediaSlot, topIcon, topCta, "Top native"); + ShowAdDisplay(topNative, topTitle, topRating, topBody, topCta, topIcon); + } + if (bottomNative != null && bottomNative.CanPlay()) + { + AttachToSlot(bottomNative, bottomMediaSlot, bottomIcon, bottomCta, "Bottom native"); + ShowAdDisplay(bottomNative, bottomTitle, bottomRating, bottomBody, bottomCta, bottomIcon); + } + #else + Log("Native not supported in editor"); + #endif + } + + void OnDetachBoth() + { + Log("Detach Both tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + topNative?.Detach(); + bottomNative?.Detach(); + ClearAdDisplay(topTitle, topRating, topBody, topCta, topIcon); + ClearAdDisplay(bottomTitle, bottomRating, bottomBody, bottomCta, bottomIcon); + Log("Both natives detached"); + #else + Log("Native not supported in editor"); + #endif + } + + void OnLoadBoth() + { + Log("Load Both tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + string placementId = VungleConstants.NativePlacementId; + + // Destroy previous ads so their native views are unregistered + // and released before new ones take over + topNative?.Destroy(); + bottomNative?.Destroy(); + + topNative = new VungleNative(placementId); + topNative.onLoadSuccess += () => Log("Top native loaded"); + topNative.onLoadFailed += (err) => Log("Top native load failed: " + err); + topNative.onDidPresent += () => Log("Top native presented"); + topNative.onPresentFailed += (err) => Log("Top native present failed: " + err); + topNative.onDidClose += () => { Log("Top native closed"); topNative = null; }; + topNative.onImpression += () => Log("Top native impression"); + topNative.onClick += () => Log("Top native click"); + topNative.onAdDataReceived += (title, body, cta, rating, iconUrl) => + { + Log($"Top native data: title={title}, cta={cta}, rating={rating}"); + }; + topNative.Load(); + Log("Top native loading..."); + + bottomNative = new VungleNative(placementId); + bottomNative.onLoadSuccess += () => Log("Bottom native loaded"); + bottomNative.onLoadFailed += (err) => Log("Bottom native load failed: " + err); + bottomNative.onDidPresent += () => Log("Bottom native presented"); + bottomNative.onPresentFailed += (err) => Log("Bottom native present failed: " + err); + bottomNative.onDidClose += () => { Log("Bottom native closed"); bottomNative = null; }; + bottomNative.onImpression += () => Log("Bottom native impression"); + bottomNative.onClick += () => Log("Bottom native click"); + bottomNative.onAdDataReceived += (title, body, cta, rating, iconUrl) => + { + Log($"Bottom native data: title={title}, cta={cta}, rating={rating}"); + }; + bottomNative.Load(); + Log("Bottom native loading..."); + #else + Log("Native not supported in editor"); + #endif + } + } +} diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualNativeController.cs.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualNativeController.cs.meta new file mode 100644 index 0000000..c198b4c --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/DualNativeController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: db21d1fdfa27541e79628a45ad7335ed +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/InterstitialController.cs b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/InterstitialController.cs new file mode 100644 index 0000000..b880cfa --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/InterstitialController.cs @@ -0,0 +1,114 @@ +using System.Collections; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.SceneManagement; +using TMPro; +using VungleAds; + +namespace VungleAds.Samples +{ + public class InterstitialController : MonoBehaviour + { + TMP_Text logText; + ScrollRect logScroll; + bool logDirty; + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + VungleInterstitial interstitialAd; + #endif + + void Start() + { + var content = UIHelper.SetupScene(); + + UIHelper.CreateBackButton(content, () => { Log("Back tapped"); SceneManager.LoadScene("LaunchScene"); }); + UIHelper.CreateTitle("Interstitial", content); + UIHelper.CreateSpacer(content, 8); + + UIHelper.CreateButton("Load", content, OnLoad); + UIHelper.CreateSpacer(content, 4); + UIHelper.CreateButton("Present", content, OnPresent); + + UIHelper.CreateSpacer(content, 12); + UIHelper.CreateLabel("Log", content, 22, FontStyles.Bold); + var (lt, sr) = UIHelper.CreateLogArea(content); + logText = lt; + logScroll = sr; + UIHelper.CreateButton("Clear Log", content, () => VungleTestManager.Instance.ClearLog(), + 50, new Color(0.38f, 0.38f, 0.43f)); + + VungleTestManager.Instance.OnLogChanged += MarkLogDirty; + logDirty = true; + } + + void OnDestroy() + { + if (VungleTestManager.HasInstance) + VungleTestManager.Instance.OnLogChanged -= MarkLogDirty; + } + + void MarkLogDirty() => logDirty = true; + + void Update() + { + if (logDirty) + { + logDirty = false; + logText.text = VungleTestManager.Instance.LogText; + StartCoroutine(ScrollToBottom()); + } + } + + IEnumerator ScrollToBottom() + { + yield return null; + logScroll.verticalNormalizedPosition = 0f; + } + + void Log(string msg) => VungleTestManager.Instance.Log(msg); + + void OnLoad() + { + Log("Load tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + interstitialAd = new VungleInterstitial(VungleConstants.InterstitialPlacementId); + SetupCallbacks(); + interstitialAd.Load(); + Log("Interstitial loading..."); + #else + Log("Interstitial not supported in editor"); + #endif + } + + void OnPresent() + { + Log("Present tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + if (interstitialAd != null) + { + interstitialAd.Show(); + Log("Interstitial present called"); + } + else + { + Log("Interstitial not loaded"); + } + #else + Log("Interstitial not supported in editor"); + #endif + } + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + void SetupCallbacks() + { + interstitialAd.onLoadSuccess += () => Log("Interstitial loaded"); + interstitialAd.onLoadFailed += (err) => Log("Interstitial load failed: " + err); + interstitialAd.onDidPresent += () => Log("Interstitial presented"); + interstitialAd.onPresentFailed += (err) => Log("Interstitial present failed: " + err); + interstitialAd.onDidClose += () => { Log("Interstitial closed"); interstitialAd = null; }; + interstitialAd.onImpression += () => Log("Interstitial impression"); + interstitialAd.onClick += () => Log("Interstitial click"); + } + #endif + } +} diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/InterstitialController.cs.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/InterstitialController.cs.meta new file mode 100644 index 0000000..ea5c034 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/InterstitialController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d1e2f3a4b5678901d1e2f3a4b5678901 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/LaunchController.cs b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/LaunchController.cs new file mode 100644 index 0000000..245df73 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/LaunchController.cs @@ -0,0 +1,103 @@ +using System.Collections; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.SceneManagement; +using TMPro; + +namespace VungleAds.Samples +{ + public class LaunchController : MonoBehaviour + { + TMP_Text statusLabel; + Button interstitialBtn, rewardedBtn, bannerBtn, nativeBtn, dualBannerBtn, dualNativeBtn, bannerRectTransformBtn; + TMP_Text logText; + ScrollRect logScroll; + bool logDirty; + + void Start() + { + var content = UIHelper.SetupScene(); + + UIHelper.CreateTitle("Vungle SDK Test", content); + UIHelper.CreateSpacer(content, 4); + + UIHelper.CreateButton("Initialize SDK", content, OnInitialize); + statusLabel = UIHelper.CreateLabel("Status: Not Initialized", content); + UIHelper.CreateSpacer(content, 8); + + interstitialBtn = UIHelper.CreateButton("Interstitial", content, + () => { Log("Interstitial tapped"); SceneManager.LoadScene("InterstitialScene"); }); + rewardedBtn = UIHelper.CreateButton("Rewarded", content, + () => { Log("Rewarded tapped"); SceneManager.LoadScene("RewardedScene"); }); + bannerBtn = UIHelper.CreateButton("Banner", content, + () => { Log("Banner tapped"); SceneManager.LoadScene("BannerScene"); }); + nativeBtn = UIHelper.CreateButton("Native", content, + () => { Log("Native tapped"); SceneManager.LoadScene("NativeScene"); }); + dualBannerBtn = UIHelper.CreateButton("Dual Banner", content, + () => { Log("Dual Banner tapped"); SceneManager.LoadScene("DualBanner"); }); + dualNativeBtn = UIHelper.CreateButton("Dual Native", content, + () => { Log("Dual Native tapped"); SceneManager.LoadScene("DualNative"); }); + bannerRectTransformBtn = UIHelper.CreateButton("Banner RectTransform", content, + () => { Log("Banner RectTransform tapped"); SceneManager.LoadScene("BannerRectTransformScene"); }); + + UIHelper.CreateSpacer(content, 8); + UIHelper.CreateLabel("Log", content, 22, FontStyles.Bold); + var (lt, sr) = UIHelper.CreateLogArea(content); + logText = lt; + logScroll = sr; + UIHelper.CreateButton("Clear Log", content, () => VungleTestManager.Instance.ClearLog(), + 50, new Color(0.38f, 0.38f, 0.43f)); + + UpdateButtonStates(); + VungleTestManager.Instance.OnLogChanged += MarkLogDirty; + logDirty = true; + } + + void OnDestroy() + { + if (VungleTestManager.HasInstance) + VungleTestManager.Instance.OnLogChanged -= MarkLogDirty; + } + + void MarkLogDirty() => logDirty = true; + + void Update() + { + if (logDirty) + { + logDirty = false; + UpdateButtonStates(); + logText.text = VungleTestManager.Instance.LogText; + StartCoroutine(ScrollToBottom()); + } + } + + IEnumerator ScrollToBottom() + { + yield return null; + logScroll.verticalNormalizedPosition = 0f; + } + + void UpdateButtonStates() + { + bool init = VungleTestManager.Instance.SdkInitialized; + statusLabel.text = init ? "Status: Initialized" : "Status: Not Initialized"; + statusLabel.color = init ? new Color(0.5f, 1f, 0.5f) : new Color(1f, 0.7f, 0.4f); + interstitialBtn.interactable = init; + rewardedBtn.interactable = init; + bannerBtn.interactable = init; + nativeBtn.interactable = init; + dualBannerBtn.interactable = init; + dualNativeBtn.interactable = init; + bannerRectTransformBtn.interactable = init; + } + + void Log(string msg) => VungleTestManager.Instance.Log(msg); + + void OnInitialize() + { + Log("Initialize SDK tapped"); + VungleTestManager.Instance.InitializeSdk(); + } + } +} diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/LaunchController.cs.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/LaunchController.cs.meta new file mode 100644 index 0000000..c032c68 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/LaunchController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1d2e3f4a5678901c1d2e3f4a5678901 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/NativeController.cs b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/NativeController.cs new file mode 100644 index 0000000..030ec06 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/NativeController.cs @@ -0,0 +1,479 @@ +using System.Collections; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.SceneManagement; +using TMPro; +using VungleAds; + +namespace VungleAds.Samples +{ + public class NativeController : MonoBehaviour + { + TMP_Text logText; + ScrollRect logScroll; + bool logDirty; + TMP_Text titleLabel, ratingLabel, bodyLabel, ctaLabel; + RawImage iconImage; + RectTransform mediaSlot; + RectTransform adCardTop, adCardBottom; + RectTransform iconRT, titleColRT, bodyRT, ctaBtnRT; + Transform canvasRoot; + GameObject configDialog; + bool attached; + + // CTA configuration: which ad elements are clickable (media always is) + bool clickIcon = true, clickTitle = true, clickBody = true, clickCta = true; + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + VungleNative nativeAd; + #endif + + void Start() + { + var content = UIHelper.SetupScene(); + + UIHelper.CreateBackButton(content, () => { Log("Back tapped"); SceneManager.LoadScene("LaunchScene"); }); + UIHelper.CreateTitle("Native", content); + UIHelper.CreateSpacer(content, 8); + + canvasRoot = content.GetComponentInParent().transform; + + UIHelper.CreateButton("Load", content, OnLoad); + UIHelper.CreateButton("Attach", content, OnAttach); + UIHelper.CreateButton("Detach", content, OnDetach); + UIHelper.CreateButton("CTA Configuration", content, OnCtaConfiguration, + 70, new Color(0.55f, 0.4f, 0.85f)); + + UIHelper.CreateSpacer(content, 12); + + // --- Ad card (matches native ad reference layout) --- + + // Header row: icon + title/rating + adCardTop = CreateAdHeader(content); + + // MediaView placeholder (native overlay renders on top of this) + mediaSlot = CreateMediaSlot(content); + + // Body text + bodyLabel = UIHelper.CreateLabel("", content, 24, FontStyles.Normal, + TextAlignmentOptions.MidlineLeft, 50); + bodyRT = (RectTransform)bodyLabel.transform; + + // CTA button (green, left-aligned) + ctaLabel = CreateCtaButton(content); + + // --- End ad card --- + + UIHelper.CreateSpacer(content, 8); + UIHelper.CreateLabel("Log", content, 22, FontStyles.Bold); + var (lt, sr) = UIHelper.CreateLogArea(content); + logText = lt; + logScroll = sr; + UIHelper.CreateButton("Clear Log", content, () => VungleTestManager.Instance.ClearLog(), + 50, new Color(0.38f, 0.38f, 0.43f)); + + VungleTestManager.Instance.OnLogChanged += MarkLogDirty; + logDirty = true; + } + + RectTransform CreateAdHeader(Transform parent) + { + var row = UIHelper.CreateHorizontalGroup(parent, 110, 16); + + // Icon frame (fixed width in HLG) + var iconFrame = new GameObject("IconFrame"); + iconFrame.transform.SetParent(row, false); + var iconLE = iconFrame.AddComponent(); + iconLE.minWidth = 110; + iconLE.preferredWidth = 110; + iconLE.flexibleWidth = 0; + iconRT = (RectTransform)iconFrame.transform; + + // Icon image inside frame with aspect ratio fitter + var iconObj = new GameObject("Icon", typeof(RectTransform)); + iconObj.transform.SetParent(iconFrame.transform, false); + var iconImgRT = (RectTransform)iconObj.transform; + iconImgRT.anchorMin = Vector2.zero; + iconImgRT.anchorMax = Vector2.one; + iconImgRT.offsetMin = Vector2.zero; + iconImgRT.offsetMax = Vector2.zero; + iconImage = iconObj.AddComponent(); + iconImage.color = new Color(0.2f, 0.2f, 0.25f); + var iconFitter = iconObj.AddComponent(); + iconFitter.aspectMode = AspectRatioFitter.AspectMode.FitInParent; + iconFitter.aspectRatio = 1f; + + // Text column (title + rating) + var textCol = new GameObject("InfoCol"); + textCol.transform.SetParent(row, false); + var textLE = textCol.AddComponent(); + textLE.flexibleWidth = 1; + var vlg = textCol.AddComponent(); + vlg.childForceExpandHeight = true; + vlg.childControlHeight = true; + vlg.childForceExpandWidth = true; + vlg.childControlWidth = true; + vlg.spacing = 4; + vlg.childAlignment = TextAnchor.MiddleLeft; + + titleLabel = AddText("--", textCol.transform, 28, FontStyles.Bold, Color.white); + ratingLabel = AddText("Rating: --", textCol.transform, 20, FontStyles.Normal, + new Color(0.7f, 0.7f, 0.7f)); + titleColRT = (RectTransform)textCol.transform; + return row; + } + + RectTransform CreateMediaSlot(Transform parent) + { + var obj = new GameObject("MediaSlot"); + obj.transform.SetParent(parent, false); + var le = obj.AddComponent(); + le.minHeight = 500; + le.preferredHeight = 500; + obj.AddComponent().color = new Color(0.15f, 0.15f, 0.2f); + return (RectTransform)obj.transform; + } + + TMP_Text CreateCtaButton(Transform parent) + { + var row = new GameObject("CtaRow", typeof(RectTransform)); + row.transform.SetParent(parent, false); + var rowLE = row.AddComponent(); + rowLE.minHeight = 60; + rowLE.preferredHeight = 60; + adCardBottom = (RectTransform)row.transform; + + var btnObj = new GameObject("CtaBtn", typeof(RectTransform)); + btnObj.transform.SetParent(row.transform, false); + var btnRT = (RectTransform)btnObj.transform; + btnRT.anchorMin = new Vector2(0, 0); + btnRT.anchorMax = new Vector2(0, 1); + btnRT.pivot = new Vector2(0, 0.5f); + btnRT.sizeDelta = new Vector2(220, 0); + btnRT.anchoredPosition = Vector2.zero; + btnObj.AddComponent().color = new Color(0.18f, 0.72f, 0.33f); + ctaBtnRT = btnRT; + + var textObj = new GameObject("Text", typeof(RectTransform)); + textObj.transform.SetParent(btnObj.transform, false); + var textRT = (RectTransform)textObj.transform; + textRT.anchorMin = Vector2.zero; + textRT.anchorMax = Vector2.one; + textRT.offsetMin = Vector2.zero; + textRT.offsetMax = Vector2.zero; + + var label = textObj.AddComponent(); + label.text = ""; + label.fontSize = 24; + label.fontStyle = FontStyles.Bold; + label.color = Color.white; + label.alignment = TextAlignmentOptions.Center; + return label; + } + + TMP_Text AddText(string text, Transform parent, float fontSize, FontStyles style, Color color) + { + var obj = new GameObject("Text"); + obj.transform.SetParent(parent, false); + var t = obj.AddComponent(); + t.text = text; + t.fontSize = fontSize; + t.fontStyle = style; + t.color = color; + t.alignment = TextAlignmentOptions.MidlineLeft; + return t; + } + + void OnDestroy() + { + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + nativeAd?.Destroy(); + nativeAd = null; + #endif + if (VungleTestManager.HasInstance) + VungleTestManager.Instance.OnLogChanged -= MarkLogDirty; + } + + void MarkLogDirty() => logDirty = true; + + void Update() + { + if (logDirty) + { + logDirty = false; + logText.text = VungleTestManager.Instance.LogText; + StartCoroutine(ScrollToBottom()); + } + } + + IEnumerator ScrollToBottom() + { + yield return null; + logScroll.verticalNormalizedPosition = 0f; + } + + void Log(string msg) => VungleTestManager.Instance.Log(msg); + + void UpdateAdDisplay(string title, string body, string cta, double rating, string iconUrl) + { + titleLabel.text = string.IsNullOrEmpty(title) ? "--" : title; + ratingLabel.text = "Rating: " + (rating > 0 ? rating.ToString("F1") : "0.0"); + bodyLabel.text = string.IsNullOrEmpty(body) ? "" : body; + ctaLabel.text = string.IsNullOrEmpty(cta) ? "" : cta; + if (!string.IsNullOrEmpty(iconUrl)) + StartCoroutine(LoadIcon(iconUrl)); + } + + IEnumerator LoadIcon(string url) + { + yield return UIHelper.LoadImageFromPath(url, iconImage); + if (iconImage.texture != null) + { + var fitter = iconImage.GetComponent(); + if (fitter != null) + fitter.aspectRatio = (float)iconImage.texture.width / iconImage.texture.height; + } + } + + void ClearAdDisplay() + { + titleLabel.text = "--"; + ratingLabel.text = "Rating: --"; + bodyLabel.text = ""; + ctaLabel.text = ""; + iconImage.texture = null; + iconImage.color = new Color(0.2f, 0.2f, 0.25f); + var fitter = iconImage.GetComponent(); + if (fitter != null) fitter.aspectRatio = 1f; + } + + void OnLoad() + { + Log("Load tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + // Destroy the previous ad so its native views are unregistered + // and released before a new one takes over + if (nativeAd != null) + { + nativeAd.Destroy(); + attached = false; + ClearAdDisplay(); + Log("Destroyed previous native ad"); + } + nativeAd = new VungleNative(VungleConstants.NativePlacementId); + SetupCallbacks(); + nativeAd.Load(); + Log("Native loading..."); + #else + Log("Native not supported in editor"); + #endif + } + + void OnAttach() + { + Log("Attach tapped"); + DoAttach(); + } + + // Attach the native container over the whole ad card (header through + // CTA), with the MediaView laid out over the mediaSlot placeholder. + // The elements enabled in the CTA Configuration dialog are registered + // as clickable regions; the media view is always clickable. + void DoAttach() + { + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + if (nativeAd == null) + { + Log("No native ad loaded"); + return; + } + + Canvas canvas = mediaSlot.GetComponentInParent(); + Camera cam = canvas.renderMode == RenderMode.ScreenSpaceOverlay ? null : canvas.worldCamera; + + var (mediaMin, mediaMax) = GetScreenRect(mediaSlot, cam); + var (topMin, topMax) = GetScreenRect(adCardTop, cam); + var (bottomMin, bottomMax) = GetScreenRect(adCardBottom, cam); + + Vector2 cardMin = Vector2.Min(Vector2.Min(topMin, bottomMin), mediaMin); + Vector2 cardMax = Vector2.Max(Vector2.Max(topMax, bottomMax), mediaMax); + + int x = (int)cardMin.x; + int y = (int)(Screen.height - cardMax.y); + int w = (int)(cardMax.x - cardMin.x); + int h = (int)(cardMax.y - cardMin.y); + int mx = (int)mediaMin.x; + int my = (int)(Screen.height - mediaMax.y); + int mw = (int)(mediaMax.x - mediaMin.x); + int mh = (int)(mediaMax.y - mediaMin.y); + + var clickableRects = new System.Collections.Generic.List(); + var clickableNames = new System.Collections.Generic.List(); + void AddClickable(bool enabled, RectTransform rt, string name) + { + if (!enabled) return; + var (rmin, rmax) = GetScreenRect(rt, cam); + clickableRects.Add(ToScreenRectInt(rmin, rmax)); + clickableNames.Add(name); + } + // The SDK only makes the media view clickable by default when NO + // clickable list is given, so this sample always includes it. + // Publishers can leave it out to make media not clickable. + AddClickable(true, mediaSlot, "media"); + AddClickable(clickIcon, iconRT, "icon"); + AddClickable(clickTitle, titleColRT, "title"); + AddClickable(clickBody, bodyRT, "body"); + AddClickable(clickCta, ctaBtnRT, "CTA"); + + nativeAd.Attach(x, y, w, h, mx, my, mw, mh, + clickableRects.Count > 0 ? clickableRects.ToArray() : null); + attached = true; + UpdateAdDisplay(nativeAd.AdTitle, nativeAd.AdBody, nativeAd.AdCallToAction, + nativeAd.AdStarRating, nativeAd.AdIconUrl); + Log($"Native attached at ({x},{y} {w}x{h}), clickable: {string.Join(", ", clickableNames)}"); + #else + Log("Native not supported in editor"); + #endif + } + + void OnDetach() + { + Log("Detach tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + if (nativeAd == null) return; + nativeAd.Detach(); + attached = false; + ClearAdDisplay(); + Log("Native detached"); + #else + Log("Native not supported in editor"); + #endif + } + + // --- CTA Configuration dialog --- + + void OnCtaConfiguration() + { + Log("CTA Configuration tapped"); + + // The native overlay renders above all Unity UI, so hide it while + // the dialog is open; Done re-attaches with the new configuration. + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + if (attached && nativeAd != null) + nativeAd.Detach(); + #endif + + if (configDialog != null) + { + configDialog.SetActive(true); + return; + } + + // Dim overlay blocking the scene behind the dialog + configDialog = new GameObject("CtaConfigDialog", typeof(RectTransform)); + configDialog.transform.SetParent(canvasRoot, false); + var overlayRT = (RectTransform)configDialog.transform; + overlayRT.anchorMin = Vector2.zero; + overlayRT.anchorMax = Vector2.one; + overlayRT.offsetMin = Vector2.zero; + overlayRT.offsetMax = Vector2.zero; + configDialog.AddComponent().color = new Color(0, 0, 0, 0.7f); + + // Centered panel + var panel = new GameObject("Panel", typeof(RectTransform)); + panel.transform.SetParent(configDialog.transform, false); + var panelRT = (RectTransform)panel.transform; + panelRT.anchorMin = new Vector2(0.5f, 0.5f); + panelRT.anchorMax = new Vector2(0.5f, 0.5f); + panelRT.pivot = new Vector2(0.5f, 0.5f); + panelRT.sizeDelta = new Vector2(640, 0); + panel.AddComponent().color = new Color(0.16f, 0.16f, 0.22f); + var fitter = panel.AddComponent(); + fitter.verticalFit = ContentSizeFitter.FitMode.PreferredSize; + var vlg = panel.AddComponent(); + vlg.spacing = 10; + vlg.padding = new RectOffset(20, 20, 20, 20); + vlg.childForceExpandWidth = true; + vlg.childForceExpandHeight = false; + vlg.childControlWidth = true; + vlg.childControlHeight = true; + + UIHelper.CreateLabel("CTA Configuration", panel.transform, 30, FontStyles.Bold); + UIHelper.CreateLabel("Select which ad elements are clickable.\nThis sample always includes the media view.", + panel.transform, 20, FontStyles.Normal, TextAlignmentOptions.Center, 60); + UIHelper.CreateSpacer(panel.transform, 4); + + CreateToggleButton(panel.transform, "Icon", () => clickIcon, v => clickIcon = v); + CreateToggleButton(panel.transform, "Title / Rating", () => clickTitle, v => clickTitle = v); + CreateToggleButton(panel.transform, "Body Text", () => clickBody, v => clickBody = v); + CreateToggleButton(panel.transform, "CTA Button", () => clickCta, v => clickCta = v); + + UIHelper.CreateSpacer(panel.transform, 4); + UIHelper.CreateButton("Done", panel.transform, () => + { + configDialog.SetActive(false); + Log($"CTA config: icon={clickIcon}, title={clickTitle}, body={clickBody}, cta={clickCta}"); + if (attached) + { + Log("Re-attaching with new CTA configuration"); + DoAttach(); + } + }, 60); + + // Ensure the dialog renders above everything else in the canvas + configDialog.transform.SetAsLastSibling(); + } + + void CreateToggleButton(Transform parent, string label, + System.Func get, System.Action set) + { + Button btn = null; + btn = UIHelper.CreateButton("", parent, () => + { + set(!get()); + RefreshToggleButton(btn, label, get()); + }, 60); + RefreshToggleButton(btn, label, get()); + } + + void RefreshToggleButton(Button btn, string label, bool on) + { + btn.GetComponent().color = on + ? new Color(0.18f, 0.72f, 0.33f) + : new Color(0.38f, 0.38f, 0.43f); + btn.GetComponentInChildren().text = $"{label}: {(on ? "Clickable" : "Not clickable")}"; + } + + (Vector2 min, Vector2 max) GetScreenRect(RectTransform rt, Camera cam) + { + Vector3[] corners = new Vector3[4]; + rt.GetWorldCorners(corners); + Vector2 min = RectTransformUtility.WorldToScreenPoint(cam, corners[0]); + Vector2 max = RectTransformUtility.WorldToScreenPoint(cam, corners[2]); + return (min, max); + } + + RectInt ToScreenRectInt(Vector2 min, Vector2 max) + { + return new RectInt((int)min.x, (int)(Screen.height - max.y), + (int)(max.x - min.x), (int)(max.y - min.y)); + } + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + void SetupCallbacks() + { + nativeAd.onLoadSuccess += () => Log("Native loaded"); + nativeAd.onLoadFailed += (err) => Log("Native load failed: " + err); + nativeAd.onDidPresent += () => Log("Native presented"); + nativeAd.onPresentFailed += (err) => Log("Native present failed: " + err); + nativeAd.onDidClose += () => { Log("Native closed"); nativeAd = null; attached = false; }; + nativeAd.onImpression += () => Log("Native impression"); + nativeAd.onClick += () => Log("Native click"); + nativeAd.onAdDataReceived += (title, body, cta, rating, iconUrl) => + { + Log($"Native data: title={title}, cta={cta}, rating={rating}"); + }; + } + #endif + } +} diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/NativeController.cs.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/NativeController.cs.meta new file mode 100644 index 0000000..ffe985b --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/NativeController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/RewardedController.cs b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/RewardedController.cs new file mode 100644 index 0000000..af625bd --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/RewardedController.cs @@ -0,0 +1,115 @@ +using System.Collections; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.SceneManagement; +using TMPro; +using VungleAds; + +namespace VungleAds.Samples +{ + public class RewardedController : MonoBehaviour + { + TMP_Text logText; + ScrollRect logScroll; + bool logDirty; + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + VungleRewarded rewardedAd; + #endif + + void Start() + { + var content = UIHelper.SetupScene(); + + UIHelper.CreateBackButton(content, () => { Log("Back tapped"); SceneManager.LoadScene("LaunchScene"); }); + UIHelper.CreateTitle("Rewarded", content); + UIHelper.CreateSpacer(content, 8); + + UIHelper.CreateButton("Load", content, OnLoad); + UIHelper.CreateSpacer(content, 4); + UIHelper.CreateButton("Present", content, OnPresent); + + UIHelper.CreateSpacer(content, 12); + UIHelper.CreateLabel("Log", content, 22, FontStyles.Bold); + var (lt, sr) = UIHelper.CreateLogArea(content); + logText = lt; + logScroll = sr; + UIHelper.CreateButton("Clear Log", content, () => VungleTestManager.Instance.ClearLog(), + 50, new Color(0.38f, 0.38f, 0.43f)); + + VungleTestManager.Instance.OnLogChanged += MarkLogDirty; + logDirty = true; + } + + void OnDestroy() + { + if (VungleTestManager.HasInstance) + VungleTestManager.Instance.OnLogChanged -= MarkLogDirty; + } + + void MarkLogDirty() => logDirty = true; + + void Update() + { + if (logDirty) + { + logDirty = false; + logText.text = VungleTestManager.Instance.LogText; + StartCoroutine(ScrollToBottom()); + } + } + + IEnumerator ScrollToBottom() + { + yield return null; + logScroll.verticalNormalizedPosition = 0f; + } + + void Log(string msg) => VungleTestManager.Instance.Log(msg); + + void OnLoad() + { + Log("Load tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + rewardedAd = new VungleRewarded(VungleConstants.RewardedPlacementId); + SetupCallbacks(); + rewardedAd.Load(); + Log("Rewarded loading..."); + #else + Log("Rewarded not supported in editor"); + #endif + } + + void OnPresent() + { + Log("Present tapped"); + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + if (rewardedAd != null) + { + rewardedAd.Show(); + Log("Rewarded present called"); + } + else + { + Log("Rewarded not loaded"); + } + #else + Log("Rewarded not supported in editor"); + #endif + } + + #if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR + void SetupCallbacks() + { + rewardedAd.onLoadSuccess += () => Log("Rewarded loaded"); + rewardedAd.onLoadFailed += (err) => Log("Rewarded load failed: " + err); + rewardedAd.onDidPresent += () => Log("Rewarded presented"); + rewardedAd.onPresentFailed += (err) => Log("Rewarded present failed: " + err); + rewardedAd.onDidClose += () => { Log("Rewarded closed"); rewardedAd = null; }; + rewardedAd.onDidRewardUser += () => Log("Rewarded user rewarded"); + rewardedAd.onImpression += () => Log("Rewarded impression"); + rewardedAd.onClick += () => Log("Rewarded click"); + } + #endif + } +} diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/RewardedController.cs.meta b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/RewardedController.cs.meta new file mode 100644 index 0000000..fa13805 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/RewardedController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1f2a3b4c5678901e1f2a3b4c5678901 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/UIHelper.cs b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/UIHelper.cs new file mode 100644 index 0000000..d8c66c2 --- /dev/null +++ b/AndroidIOS/VungleSDKSampleApp/Assets/Samples/Scripts/UIHelper.cs @@ -0,0 +1,340 @@ +using System.Collections; +using UnityEngine; +using UnityEngine.Networking; +using UnityEngine.UI; +using UnityEngine.EventSystems; +using TMPro; + +namespace VungleAds.Samples +{ + public static class UIHelper + { + static bool fontFallbackInitialized; + + // Ad text is arbitrary publisher/advertiser content (CJK, Cyrillic, + // Arabic, ...). The TMP Essential Resources font (LiberationSans SDF) + // only covers Latin, so register dynamic fallback font assets built + // from OS fonts — missing glyphs are then rasterized on demand. + // (Color emoji are not covered by SDF text rendering.) + static void EnsureFontFallback() + { + if (fontFallbackInitialized) return; + fontFallbackInitialized = true; + + string[] installed = Font.GetOSInstalledFontNames(); + Debug.Log("[VungleSample] OS fonts: " + string.Join(", ", installed)); + + // Substring match by priority: device font naming varies — e.g. + // Android's NotoSansCJK-Regular.ttc exposes per-locale faces like + // "Noto Sans CJK KR" — so exact names are too fragile. + string[] wanted = + { + "CJK", // Android pan-CJK (KR/JP/SC/TC faces) + "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", + "PingFang", "Hiragino", "Apple SD Gothic", // iOS CJK + "Noto Sans", "Roboto", "Helvetica", // Latin & friends + }; + var added = new System.Collections.Generic.List(); + foreach (string pattern in wanted) + { + foreach (string name in installed) + { + if (added.Count >= 6) break; // bound the fallback chain + if (name.IndexOf(pattern, System.StringComparison.OrdinalIgnoreCase) < 0) continue; + if (added.Contains(name)) continue; + Font osFont = Font.CreateDynamicFontFromOSFont(name, 24); + if (osFont == null) continue; + TMP_FontAsset asset = TMP_FontAsset.CreateFontAsset(osFont); + if (asset == null) continue; + TMP_Settings.fallbackFontAssets.Add(asset); + added.Add(name); + } + } + Debug.Log("[VungleSample] TMP fallback fonts added: " + + (added.Count > 0 ? string.Join(", ", added) : "NONE")); + } + + public static RectTransform SetupScene() + { + EnsureFontFallback(); + + if (Object.FindAnyObjectByType() == null) + { + var es = new GameObject("EventSystem"); + es.AddComponent(); + es.AddComponent(); + } + + var canvasObj = new GameObject("Canvas"); + var canvas = canvasObj.AddComponent(); + canvas.renderMode = RenderMode.ScreenSpaceOverlay; + + var scaler = canvasObj.AddComponent(); + scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; + scaler.referenceResolution = new Vector2(1080, 1920); + scaler.matchWidthOrHeight = 0.5f; + + canvasObj.AddComponent(); + + var bg = AddChild("Background", canvasObj.transform); + Stretch(bg); + bg.gameObject.AddComponent().color = new Color(0.12f, 0.12f, 0.18f); + + var safeArea = Screen.safeArea; + var safeRT = AddChild("SafeArea", bg); + safeRT.anchorMin = new Vector2(safeArea.x / Screen.width, safeArea.y / Screen.height); + safeRT.anchorMax = new Vector2((safeArea.x + safeArea.width) / Screen.width, + (safeArea.y + safeArea.height) / Screen.height); + safeRT.offsetMin = Vector2.zero; + safeRT.offsetMax = Vector2.zero; + + var content = AddChild("Content", safeRT); + Stretch(content); + content.offsetMin = new Vector2(24, 24); + content.offsetMax = new Vector2(-24, -24); + + var vlg = content.gameObject.AddComponent(); + vlg.spacing = 12; + vlg.childAlignment = TextAnchor.UpperCenter; + vlg.childForceExpandWidth = true; + vlg.childForceExpandHeight = false; + vlg.childControlWidth = true; + vlg.childControlHeight = true; + + return content; + } + + public static TMP_Text CreateTitle(string text, Transform parent) + { + return CreateLabel(text, parent, 40, FontStyles.Bold, TextAlignmentOptions.Center, 70); + } + + public static TMP_Text CreateLabel(string text, Transform parent, float fontSize = 26, + FontStyles style = FontStyles.Normal, TextAlignmentOptions alignment = TextAlignmentOptions.Center, + float height = 40) + { + var obj = new GameObject("Label"); + obj.transform.SetParent(parent, false); + var le = obj.AddComponent(); + le.minHeight = height; + le.preferredHeight = height; + + var t = obj.AddComponent(); + t.text = text; + t.fontSize = fontSize; + t.fontStyle = style; + t.alignment = alignment; + t.color = Color.white; + return t; + } + + public static Button CreateButton(string text, Transform parent, System.Action onClick, + float height = 70, Color? color = null) + { + var btnColor = color ?? new Color(0.2f, 0.55f, 0.95f); + + var obj = new GameObject("Btn_" + text); + obj.transform.SetParent(parent, false); + var le = obj.AddComponent(); + le.minHeight = height; + le.preferredHeight = height; + + var img = obj.AddComponent(); + img.color = btnColor; + + var btn = obj.AddComponent