init
This commit is contained in:
BIN
Assets/AdManager/Ad Break-Portrait.png
Normal file
BIN
Assets/AdManager/Ad Break-Portrait.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
132
Assets/AdManager/Ad Break-Portrait.png.meta
Normal file
132
Assets/AdManager/Ad Break-Portrait.png.meta
Normal file
@@ -0,0 +1,132 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ef5109b2fcba47899d4f2b311da9340
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Android
|
||||
maxTextureSize: 1024
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 29
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: db9c1cfaf5e844b4b95de665ca9c13db
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
47
Assets/AdManager/AdInitialize.prefab
Normal file
47
Assets/AdManager/AdInitialize.prefab
Normal file
@@ -0,0 +1,47 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &6809933845309457802
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2929833845123913221}
|
||||
- component: {fileID: 2784282074210547776}
|
||||
m_Layer: 0
|
||||
m_Name: AdInitialize
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2929833845123913221
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6809933845309457802}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &2784282074210547776
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6809933845309457802}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5510446fff21946f7a51cf3f88d7035c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
AdManagerPrefb: {fileID: 1824684813513001599, guid: 35a705b02bb1a43fb880f76f97132163,
|
||||
type: 3}
|
||||
7
Assets/AdManager/AdInitialize.prefab.meta
Normal file
7
Assets/AdManager/AdInitialize.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 923183203185a42088acdd719386583a
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
546
Assets/AdManager/AdManager.cs
Normal file
546
Assets/AdManager/AdManager.cs
Normal file
@@ -0,0 +1,546 @@
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Advertisements;
|
||||
|
||||
public enum BannerPosition
|
||||
{
|
||||
TopLeft,
|
||||
TopCenter,
|
||||
TopRight,
|
||||
Centered,
|
||||
CenterLeft,
|
||||
CenterRight,
|
||||
BottomLeft,
|
||||
BottomCenter,
|
||||
BottomRight
|
||||
}
|
||||
|
||||
public enum MBRPosition
|
||||
{
|
||||
TopLeft,
|
||||
TopCenter,
|
||||
TopRight,
|
||||
Centered,
|
||||
CenterLeft,
|
||||
CenterRight,
|
||||
BottomLeft,
|
||||
BottomCenter,
|
||||
BottomRight
|
||||
}
|
||||
|
||||
public class AdManager : MonoBehaviour
|
||||
|
||||
{
|
||||
public string MaxSdkKey = "Enter_SDK_Key_HERE";
|
||||
public string InterstitialAdUnitId = "ENTER_INTER_AD_UNIT_ID_HERE";
|
||||
public string RewardedAdUnitId = "ENTER_REWARD_AD_UNIT_ID_HERE";
|
||||
public string RewardedInterstitialAdUnitId = "ENTER_REWARD_INTER_AD_UNIT_ID_HERE";
|
||||
public string BannerAdUnitId = "ENTER_BANNER_AD_UNIT_ID_HERE";
|
||||
public string MRecAdUnitId = "ENTER_MBR_AD_UNIT_ID_HERE";
|
||||
|
||||
|
||||
|
||||
[Header("Banner & MBR Settings")]
|
||||
|
||||
|
||||
public BannerPosition BannerPosition = BannerPosition.TopCenter;
|
||||
MaxSdkBase.BannerPosition position;
|
||||
public MBRPosition MBRPosition = MBRPosition.BottomCenter;
|
||||
MaxSdkBase.AdViewPosition MBRposition;
|
||||
|
||||
public bool AutoShowBanner=true;
|
||||
|
||||
|
||||
private bool isBannerShowing;
|
||||
private bool isMRecShowing;
|
||||
|
||||
private int interstitialRetryAttempt;
|
||||
private int rewardedRetryAttempt;
|
||||
private int rewardedInterstitialRetryAttempt;
|
||||
|
||||
public float IntestetailAdbreakDelay;
|
||||
|
||||
private bool ShowIntestetial=false;
|
||||
|
||||
private float timecounter;
|
||||
|
||||
public static AdManager _Instance;
|
||||
|
||||
private static bool IsAdUnitArrayNullOrEmpty (ICollection<string> adUnitArray)
|
||||
{
|
||||
return (adUnitArray == null || adUnitArray.Count == 0);
|
||||
}
|
||||
|
||||
void Awake ()
|
||||
{
|
||||
MakeSingleton ();
|
||||
}
|
||||
|
||||
void MakeSingleton ()
|
||||
{
|
||||
if (_Instance != null) {
|
||||
Destroy (this.gameObject);
|
||||
} else {
|
||||
_Instance = this;
|
||||
DontDestroyOnLoad (this.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
|
||||
MaxSdkCallbacks.OnSdkInitializedEvent += sdkConfiguration =>
|
||||
{
|
||||
// AppLovin SDK is initialized, configure and start loading ads.
|
||||
UnityEngine.Debug.Log("MAX SDK Initialized");
|
||||
position = (MaxSdkBase.BannerPosition)BannerPosition;
|
||||
MBRposition = (MaxSdkBase.AdViewPosition)MBRPosition;
|
||||
InitializeInterstitialAds();
|
||||
InitializeRewardedAds();
|
||||
InitializeRewardedInterstitialAds();
|
||||
InitializeBannerAds();
|
||||
InitializeMRecAds();
|
||||
};
|
||||
MaxSdk.SetSdkKey(MaxSdkKey);
|
||||
MaxSdk.InitializeSdk();
|
||||
}
|
||||
|
||||
void Update(){
|
||||
if(ShowIntestetial){
|
||||
timecounter+=Time.unscaledDeltaTime;
|
||||
if(timecounter>=IntestetailAdbreakDelay){
|
||||
ShowIntestetial=false;
|
||||
timecounter=0;
|
||||
ShowIntestetialafterdelay();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region Interstitial Ad Methods
|
||||
|
||||
private void InitializeInterstitialAds()
|
||||
{
|
||||
// Attach callbacks
|
||||
MaxSdkCallbacks.Interstitial.OnAdLoadedEvent += OnInterstitialLoadedEvent;
|
||||
MaxSdkCallbacks.Interstitial.OnAdLoadFailedEvent += OnInterstitialFailedEvent;
|
||||
MaxSdkCallbacks.Interstitial.OnAdDisplayFailedEvent += InterstitialFailedToDisplayEvent;
|
||||
MaxSdkCallbacks.Interstitial.OnAdHiddenEvent += OnInterstitialDismissedEvent;
|
||||
MaxSdkCallbacks.Interstitial.OnAdRevenuePaidEvent += OnInterstitialRevenuePaidEvent;
|
||||
|
||||
// Load the first interstitial
|
||||
LoadInterstitial();
|
||||
}
|
||||
|
||||
void LoadInterstitial()
|
||||
{
|
||||
MaxSdk.LoadInterstitial(InterstitialAdUnitId);
|
||||
}
|
||||
|
||||
public void ShowInterstitial()
|
||||
{
|
||||
if (MaxSdk.IsInterstitialReady(InterstitialAdUnitId))
|
||||
{
|
||||
this.gameObject.transform.GetChild(0).gameObject.SetActive(true);
|
||||
ShowIntestetial=true;
|
||||
}
|
||||
}
|
||||
|
||||
void ShowIntestetialafterdelay(){
|
||||
this.gameObject.transform.GetChild(0).gameObject.SetActive(false);
|
||||
MaxSdk.ShowInterstitial(InterstitialAdUnitId);
|
||||
|
||||
}
|
||||
|
||||
private void OnInterstitialLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Interstitial ad is ready to be shown. MaxSdk.IsInterstitialReady(interstitialAdUnitId) will now return 'true'
|
||||
|
||||
|
||||
// Reset retry attempt
|
||||
interstitialRetryAttempt = 0;
|
||||
}
|
||||
|
||||
private void OnInterstitialFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
|
||||
{
|
||||
// Interstitial ad failed to load. We recommend retrying with exponentially higher delays up to a maximum delay (in this case 64 seconds).
|
||||
interstitialRetryAttempt++;
|
||||
double retryDelay = Math.Pow(2, Math.Min(6, interstitialRetryAttempt));
|
||||
|
||||
UnityEngine.Debug.Log("Interstitial failed to load with error code: " + errorInfo.Code);
|
||||
|
||||
Invoke("LoadInterstitial", (float) retryDelay);
|
||||
}
|
||||
|
||||
private void InterstitialFailedToDisplayEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Interstitial ad failed to display. We recommend loading the next ad
|
||||
UnityEngine.Debug.Log("Interstitial failed to display with error code: " + errorInfo.Code);
|
||||
LoadInterstitial();
|
||||
}
|
||||
|
||||
private void OnInterstitialDismissedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Interstitial ad is hidden. Pre-load the next ad
|
||||
UnityEngine.Debug.Log("Interstitial dismissed");
|
||||
LoadInterstitial();
|
||||
}
|
||||
|
||||
private void OnInterstitialRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Interstitial ad revenue paid. Use this callback to track user revenue.
|
||||
UnityEngine.Debug.Log("Interstitial revenue paid");
|
||||
|
||||
// Ad revenue
|
||||
double revenue = adInfo.Revenue;
|
||||
|
||||
// Miscellaneous data
|
||||
string countryCode = MaxSdk.GetSdkConfiguration().CountryCode; // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD" in most cases!
|
||||
string networkName = adInfo.NetworkName; // Display name of the network that showed the ad (e.g. "AdColony")
|
||||
string adUnitIdentifier = adInfo.AdUnitIdentifier; // The MAX Ad Unit ID
|
||||
string placement = adInfo.Placement; // The placement this ad's postbacks are tied to
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Rewarded Ad Methods
|
||||
|
||||
private void InitializeRewardedAds()
|
||||
{
|
||||
// Attach callbacks
|
||||
MaxSdkCallbacks.Rewarded.OnAdLoadedEvent += OnRewardedAdLoadedEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdLoadFailedEvent += OnRewardedAdFailedEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdDisplayFailedEvent += OnRewardedAdFailedToDisplayEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdDisplayedEvent += OnRewardedAdDisplayedEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdClickedEvent += OnRewardedAdClickedEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdHiddenEvent += OnRewardedAdDismissedEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdReceivedRewardEvent += OnRewardedAdReceivedRewardEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdRevenuePaidEvent += OnRewardedAdRevenuePaidEvent;
|
||||
|
||||
// Load the first RewardedAd
|
||||
LoadRewardedAd();
|
||||
}
|
||||
|
||||
private void LoadRewardedAd()
|
||||
{
|
||||
MaxSdk.LoadRewardedAd(RewardedAdUnitId);
|
||||
}
|
||||
|
||||
public void showRewardedVideo()
|
||||
{
|
||||
if (MaxSdk.IsRewardedAdReady(RewardedAdUnitId))
|
||||
{
|
||||
MaxSdk.ShowRewardedAd(RewardedAdUnitId);
|
||||
}else if (MaxSdk.IsRewardedInterstitialAdReady(RewardedInterstitialAdUnitId))
|
||||
{
|
||||
MaxSdk.ShowRewardedInterstitialAd(RewardedInterstitialAdUnitId);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRewardedAdLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Rewarded ad is ready to be shown. MaxSdk.IsRewardedAdReady(rewardedAdUnitId) will now return 'true'
|
||||
UnityEngine.Debug.Log("Rewarded ad loaded");
|
||||
|
||||
// Reset retry attempt
|
||||
rewardedRetryAttempt = 0;
|
||||
}
|
||||
|
||||
private void OnRewardedAdFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
|
||||
{
|
||||
// Rewarded ad failed to load. We recommend retrying with exponentially higher delays up to a maximum delay (in this case 64 seconds).
|
||||
rewardedRetryAttempt++;
|
||||
double retryDelay = Math.Pow(2, Math.Min(6, rewardedRetryAttempt));
|
||||
PlayerPrefs.SetInt ("reward", 2);
|
||||
UnityEngine.Debug.Log("Rewarded ad failed to load with error code: " + errorInfo.Code);
|
||||
|
||||
Invoke("LoadRewardedAd", (float) retryDelay);
|
||||
}
|
||||
|
||||
private void OnRewardedAdFailedToDisplayEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Rewarded ad failed to display. We recommend loading the next ad
|
||||
PlayerPrefs.SetInt ("reward", 2);
|
||||
UnityEngine.Debug.Log("Rewarded ad failed to display with error code: " + errorInfo.Code);
|
||||
LoadRewardedAd();
|
||||
}
|
||||
|
||||
private void OnRewardedAdDisplayedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
UnityEngine.Debug.Log("Rewarded ad displayed");
|
||||
}
|
||||
|
||||
private void OnRewardedAdClickedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
UnityEngine.Debug.Log("Rewarded ad clicked");
|
||||
}
|
||||
|
||||
private void OnRewardedAdDismissedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Rewarded ad is hidden. Pre-load the next ad
|
||||
UnityEngine.Debug.Log("Rewarded ad dismissed");
|
||||
LoadRewardedAd();
|
||||
}
|
||||
|
||||
private void OnRewardedAdReceivedRewardEvent(string adUnitId, MaxSdk.Reward reward, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
|
||||
PlayerPrefs.SetInt ("reward", 1);
|
||||
// Rewarded ad was displayed and user should receive the reward
|
||||
UnityEngine.Debug.Log("Rewarded ad received reward");
|
||||
|
||||
}
|
||||
|
||||
private void OnRewardedAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Rewarded ad revenue paid. Use this callback to track user revenue.
|
||||
UnityEngine.Debug.Log("Rewarded ad revenue paid");
|
||||
|
||||
// Ad revenue
|
||||
double revenue = adInfo.Revenue;
|
||||
|
||||
// Miscellaneous data
|
||||
string countryCode = MaxSdk.GetSdkConfiguration().CountryCode; // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD" in most cases!
|
||||
string networkName = adInfo.NetworkName; // Display name of the network that showed the ad (e.g. "AdColony")
|
||||
string adUnitIdentifier = adInfo.AdUnitIdentifier; // The MAX Ad Unit ID
|
||||
string placement = adInfo.Placement; // The placement this ad's postbacks are tied to
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Rewarded Interstitial Ad Methods
|
||||
|
||||
private void InitializeRewardedInterstitialAds()
|
||||
{
|
||||
// Attach callbacks
|
||||
MaxSdkCallbacks.RewardedInterstitial.OnAdLoadedEvent += OnRewardedInterstitialAdLoadedEvent;
|
||||
MaxSdkCallbacks.RewardedInterstitial.OnAdLoadFailedEvent += OnRewardedInterstitialAdFailedEvent;
|
||||
MaxSdkCallbacks.RewardedInterstitial.OnAdDisplayFailedEvent += OnRewardedInterstitialAdFailedToDisplayEvent;
|
||||
MaxSdkCallbacks.RewardedInterstitial.OnAdDisplayedEvent += OnRewardedInterstitialAdDisplayedEvent;
|
||||
MaxSdkCallbacks.RewardedInterstitial.OnAdClickedEvent += OnRewardedInterstitialAdClickedEvent;
|
||||
MaxSdkCallbacks.RewardedInterstitial.OnAdHiddenEvent += OnRewardedInterstitialAdDismissedEvent;
|
||||
MaxSdkCallbacks.RewardedInterstitial.OnAdReceivedRewardEvent += OnRewardedInterstitialAdReceivedRewardEvent;
|
||||
MaxSdkCallbacks.RewardedInterstitial.OnAdRevenuePaidEvent += OnRewardedInterstitialAdRevenuePaidEvent;
|
||||
|
||||
// Load the first RewardedInterstitialAd
|
||||
LoadRewardedInterstitialAd();
|
||||
}
|
||||
|
||||
private void LoadRewardedInterstitialAd()
|
||||
{
|
||||
MaxSdk.LoadRewardedInterstitialAd(RewardedInterstitialAdUnitId);
|
||||
}
|
||||
|
||||
private void ShowRewardedInterstitialAd()
|
||||
{
|
||||
if (MaxSdk.IsRewardedInterstitialAdReady(RewardedInterstitialAdUnitId))
|
||||
{
|
||||
MaxSdk.ShowRewardedInterstitialAd(RewardedInterstitialAdUnitId);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRewardedInterstitialAdLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Rewarded interstitial ad is ready to be shown. MaxSdk.IsRewardedInterstitialAdReady(rewardedInterstitialAdUnitId) will now return 'true'
|
||||
UnityEngine.Debug.Log("Rewarded interstitial ad loaded");
|
||||
|
||||
// Reset retry attempt
|
||||
rewardedInterstitialRetryAttempt = 0;
|
||||
}
|
||||
|
||||
private void OnRewardedInterstitialAdFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
|
||||
{
|
||||
PlayerPrefs.SetInt ("reward", 2);
|
||||
// Rewarded interstitial ad failed to load. We recommend retrying with exponentially higher delays up to a maximum delay (in this case 64 seconds).
|
||||
rewardedInterstitialRetryAttempt++;
|
||||
double retryDelay = Math.Pow(2, Math.Min(6, rewardedInterstitialRetryAttempt));
|
||||
|
||||
UnityEngine.Debug.Log("Rewarded interstitial ad failed to load with error code: " + errorInfo.Code);
|
||||
|
||||
Invoke("LoadRewardedInterstitialAd", (float) retryDelay);
|
||||
}
|
||||
|
||||
private void OnRewardedInterstitialAdFailedToDisplayEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
PlayerPrefs.SetInt ("reward", 2);
|
||||
// Rewarded interstitial ad failed to display. We recommend loading the next ad
|
||||
UnityEngine.Debug.Log("Rewarded interstitial ad failed to display with error code: " + errorInfo.Code);
|
||||
LoadRewardedInterstitialAd();
|
||||
}
|
||||
|
||||
private void OnRewardedInterstitialAdDisplayedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
UnityEngine.Debug.Log("Rewarded interstitial ad displayed");
|
||||
}
|
||||
|
||||
private void OnRewardedInterstitialAdClickedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
UnityEngine.Debug.Log("Rewarded interstitial ad clicked");
|
||||
}
|
||||
|
||||
private void OnRewardedInterstitialAdDismissedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Rewarded interstitial ad is hidden. Pre-load the next ad
|
||||
UnityEngine.Debug.Log("Rewarded interstitial ad dismissed");
|
||||
LoadRewardedInterstitialAd();
|
||||
}
|
||||
|
||||
private void OnRewardedInterstitialAdReceivedRewardEvent(string adUnitId, MaxSdk.Reward reward, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
|
||||
PlayerPrefs.SetInt ("reward", 1);
|
||||
// Rewarded interstitial ad was displayed and user should receive the reward
|
||||
UnityEngine.Debug.Log("Rewarded interstitial ad received reward");
|
||||
}
|
||||
|
||||
private void OnRewardedInterstitialAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Rewarded interstitial ad revenue paid. Use this callback to track user revenue.
|
||||
UnityEngine.Debug.Log("Rewarded interstitial ad revenue paid");
|
||||
|
||||
// Ad revenue
|
||||
double revenue = adInfo.Revenue;
|
||||
|
||||
// Miscellaneous data
|
||||
string countryCode = MaxSdk.GetSdkConfiguration().CountryCode; // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD" in most cases!
|
||||
string networkName = adInfo.NetworkName; // Display name of the network that showed the ad (e.g. "AdColony")
|
||||
string adUnitIdentifier = adInfo.AdUnitIdentifier; // The MAX Ad Unit ID
|
||||
string placement = adInfo.Placement; // The placement this ad's postbacks are tied to
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Banner Ad Methods
|
||||
|
||||
private void InitializeBannerAds()
|
||||
{
|
||||
// Attach Callbacks
|
||||
MaxSdkCallbacks.Banner.OnAdLoadedEvent += OnBannerAdLoadedEvent;
|
||||
MaxSdkCallbacks.Banner.OnAdLoadFailedEvent += OnBannerAdFailedEvent;
|
||||
MaxSdkCallbacks.Banner.OnAdClickedEvent += OnBannerAdClickedEvent;
|
||||
MaxSdkCallbacks.Banner.OnAdRevenuePaidEvent += OnBannerAdRevenuePaidEvent;
|
||||
|
||||
// Banners are automatically sized to 320x50 on phones and 728x90 on tablets.
|
||||
// You may use the utility method `MaxSdkUtils.isTablet()` to help with view sizing adjustments.
|
||||
MaxSdk.CreateBanner(BannerAdUnitId, position);
|
||||
|
||||
// Set background or background color for banners to be fully functional.
|
||||
MaxSdk.SetBannerBackgroundColor(BannerAdUnitId, Color.black);
|
||||
}
|
||||
|
||||
public void ShowBanner ()
|
||||
{
|
||||
MaxSdk.ShowBanner(BannerAdUnitId);
|
||||
}
|
||||
|
||||
public void HideBanner (){
|
||||
MaxSdk.HideBanner(BannerAdUnitId);
|
||||
}
|
||||
|
||||
private void OnBannerAdLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
if(AutoShowBanner)
|
||||
ShowBanner();
|
||||
// Banner ad is ready to be shown.
|
||||
// If you have already called MaxSdk.ShowBanner(BannerAdUnitId) it will automatically be shown on the next ad refresh.
|
||||
UnityEngine.Debug.Log("Banner ad loaded");
|
||||
}
|
||||
|
||||
private void OnBannerAdFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
|
||||
{
|
||||
// Banner ad failed to load. MAX will automatically try loading a new ad internally.
|
||||
UnityEngine.Debug.Log("Banner ad failed to load with error code: " + errorInfo.Code);
|
||||
}
|
||||
|
||||
private void OnBannerAdClickedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
UnityEngine.Debug.Log("Banner ad clicked");
|
||||
}
|
||||
|
||||
private void OnBannerAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// Banner ad revenue paid. Use this callback to track user revenue.
|
||||
UnityEngine.Debug.Log("Banner ad revenue paid");
|
||||
|
||||
// Ad revenue
|
||||
double revenue = adInfo.Revenue;
|
||||
|
||||
// Miscellaneous data
|
||||
string countryCode = MaxSdk.GetSdkConfiguration().CountryCode; // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD" in most cases!
|
||||
string networkName = adInfo.NetworkName; // Display name of the network that showed the ad (e.g. "AdColony")
|
||||
string adUnitIdentifier = adInfo.AdUnitIdentifier; // The MAX Ad Unit ID
|
||||
string placement = adInfo.Placement; // The placement this ad's postbacks are tied to
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region MREC Ad Methods
|
||||
|
||||
private void InitializeMRecAds()
|
||||
{
|
||||
// Attach Callbacks
|
||||
MaxSdkCallbacks.MRec.OnAdLoadedEvent += OnMRecAdLoadedEvent;
|
||||
MaxSdkCallbacks.MRec.OnAdLoadFailedEvent += OnMRecAdFailedEvent;
|
||||
MaxSdkCallbacks.MRec.OnAdClickedEvent += OnMRecAdClickedEvent;
|
||||
MaxSdkCallbacks.MRec.OnAdRevenuePaidEvent += OnMRecAdRevenuePaidEvent;
|
||||
|
||||
// MRECs are automatically sized to 300x250.
|
||||
MaxSdk.CreateMRec(MRecAdUnitId, MBRposition);
|
||||
}
|
||||
|
||||
public void ShowMRec()
|
||||
{
|
||||
MaxSdk.ShowMRec(MRecAdUnitId);;
|
||||
|
||||
}
|
||||
|
||||
public void HideMRec(){
|
||||
MaxSdk.HideMRec(MRecAdUnitId);
|
||||
}
|
||||
|
||||
private void OnMRecAdLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// MRec ad is ready to be shown.
|
||||
// If you have already called MaxSdk.ShowMRec(MRecAdUnitId) it will automatically be shown on the next MRec refresh.
|
||||
UnityEngine.Debug.Log("MRec ad loaded");
|
||||
}
|
||||
|
||||
private void OnMRecAdFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
|
||||
{
|
||||
// MRec ad failed to load. MAX will automatically try loading a new ad internally.
|
||||
UnityEngine.Debug.Log("MRec ad failed to load with error code: " + errorInfo.Code);
|
||||
}
|
||||
|
||||
private void OnMRecAdClickedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
UnityEngine.Debug.Log("MRec ad clicked");
|
||||
}
|
||||
|
||||
private void OnMRecAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// MRec ad revenue paid. Use this callback to track user revenue.
|
||||
UnityEngine.Debug.Log("MRec ad revenue paid");
|
||||
|
||||
// Ad revenue
|
||||
double revenue = adInfo.Revenue;
|
||||
|
||||
// Miscellaneous data
|
||||
string countryCode = MaxSdk.GetSdkConfiguration().CountryCode; // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD" in most cases!
|
||||
string networkName = adInfo.NetworkName; // Display name of the network that showed the ad (e.g. "AdColony")
|
||||
string adUnitIdentifier = adInfo.AdUnitIdentifier; // The MAX Ad Unit ID
|
||||
string placement = adInfo.Placement; // The placement this ad's postbacks are tied to
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
public void MediationDebugger()
|
||||
{
|
||||
MaxSdk.ShowMediationDebugger();
|
||||
}
|
||||
}
|
||||
11
Assets/AdManager/AdManager.cs.meta
Normal file
11
Assets/AdManager/AdManager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19268e4ffbdff4dcba6cd9fbca2d477e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
320
Assets/AdManager/AdManager.prefab
Normal file
320
Assets/AdManager/AdManager.prefab
Normal file
@@ -0,0 +1,320 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &1824684813513001599
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1824684813513001593}
|
||||
- component: {fileID: 1824684813513001592}
|
||||
m_Layer: 0
|
||||
m_Name: AdManager
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &1824684813513001593
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684813513001599}
|
||||
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_Children:
|
||||
- {fileID: 1824684814513231900}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &1824684813513001592
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684813513001599}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 19268e4ffbdff4dcba6cd9fbca2d477e, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
MaxSdkKey: psZVEAMEWH5iW2zGUnOMSoVUytal0OxRPslmW0QNaDaGKuAZIVm2LaAfwCMoEA89NZS7TgPWdXFxEygQDpWgpD
|
||||
InterstitialAdUnitId: 28eaf3e8376363fc
|
||||
RewardedAdUnitId: 11
|
||||
RewardedInterstitialAdUnitId: 11
|
||||
BannerAdUnitId: 7df3d4278b1f559a
|
||||
MRecAdUnitId: 11
|
||||
BannerPosition: 7
|
||||
MBRPosition: 6
|
||||
AutoShowBanner: 1
|
||||
IntestetailAdbreakDelay: 1.5
|
||||
--- !u!1 &1824684813823497392
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1824684813823497393}
|
||||
- component: {fileID: 1824684813823497395}
|
||||
- component: {fileID: 1824684813823497394}
|
||||
m_Layer: 0
|
||||
m_Name: AdScreenLandScape
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1824684813823497393
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684813823497392}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 1824684814513231900}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1824684813823497395
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684813823497392}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &1824684813823497394
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684813823497392}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: a6dd9436829aa43ecb6408b08cb898fd, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &1824684814513231891
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1824684814513231900}
|
||||
- component: {fileID: 1824684814513231896}
|
||||
- component: {fileID: 1824684814513231903}
|
||||
- component: {fileID: 1824684814513231902}
|
||||
- component: {fileID: 1824684814513231901}
|
||||
m_Layer: 0
|
||||
m_Name: Canvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &1824684814513231900
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684814513231891}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0, y: 0, z: 0}
|
||||
m_Children:
|
||||
- {fileID: 1824684814686399103}
|
||||
- {fileID: 1824684813823497393}
|
||||
m_Father: {fileID: 1824684813513001593}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 0}
|
||||
--- !u!223 &1824684814513231896
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684814513231891}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 0
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_AdditionalShaderChannelsFlag: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &1824684814513231903
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684814513231891}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 1
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 0
|
||||
--- !u!114 &1824684814513231902
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684814513231891}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!114 &1824684814513231901
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684814513231891}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8edac5a1785d6478f9686aa5c11af342, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &1824684814686399102
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1824684814686399103}
|
||||
- component: {fileID: 1824684814686399097}
|
||||
- component: {fileID: 1824684814686399096}
|
||||
m_Layer: 0
|
||||
m_Name: AdScreenPortrait
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1824684814686399103
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684814686399102}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 1824684814513231900}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1824684814686399097
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684814686399102}
|
||||
m_CullTransparentMesh: 0
|
||||
--- !u!114 &1824684814686399096
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1824684814686399102}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 3ef5109b2fcba47899d4f2b311da9340, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
7
Assets/AdManager/AdManager.prefab.meta
Normal file
7
Assets/AdManager/AdManager.prefab.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35a705b02bb1a43fb880f76f97132163
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2868
Assets/AdManager/AppLovin Mediation.unity
Normal file
2868
Assets/AdManager/AppLovin Mediation.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/AdManager/AppLovin Mediation.unity.meta
Normal file
7
Assets/AdManager/AppLovin Mediation.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96fae1cfbbe8041c79ad65ccdcd807c9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
Assets/AdManager/GotoSampleScene.cs
Executable file
16
Assets/AdManager/GotoSampleScene.cs
Executable file
@@ -0,0 +1,16 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class GotoSampleScene : MonoBehaviour {
|
||||
|
||||
// Use this for initialization
|
||||
IEnumerator Start () {
|
||||
yield return new WaitForSeconds (3f);
|
||||
Application.LoadLevel(1);
|
||||
// SceneManager.LoadScene ("TW_AdsSampleScene");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
11
Assets/AdManager/GotoSampleScene.cs.meta
Normal file
11
Assets/AdManager/GotoSampleScene.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3bd691842e0004402add1276136e5c91
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
27
Assets/AdManager/MBREnableDisable.cs
Normal file
27
Assets/AdManager/MBREnableDisable.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MBREnableDisable : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnEnable(){
|
||||
AdManager._Instance.ShowMRec();
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
AdManager._Instance.HideMRec();
|
||||
}
|
||||
}
|
||||
11
Assets/AdManager/MBREnableDisable.cs.meta
Normal file
11
Assets/AdManager/MBREnableDisable.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9566f093f8f6a46589f9df9dcce2d0d7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
60
Assets/AdManager/OrientationChecker.cs
Normal file
60
Assets/AdManager/OrientationChecker.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class OrientationChecker : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void OnEnable() {
|
||||
|
||||
if(Screen.orientation == ScreenOrientation.Portrait)
|
||||
{
|
||||
this.gameObject.transform.GetChild(0).gameObject.SetActive(true);
|
||||
}
|
||||
if(Screen.orientation == ScreenOrientation.PortraitUpsideDown)
|
||||
{
|
||||
this.gameObject.transform.GetChild(0).gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
if(Screen.orientation == ScreenOrientation.LandscapeLeft)
|
||||
{
|
||||
this.gameObject.transform.GetChild(1).gameObject.SetActive(true);
|
||||
}
|
||||
if(Screen.orientation == ScreenOrientation.LandscapeRight)
|
||||
{
|
||||
this.gameObject.transform.GetChild(1).gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable() {
|
||||
|
||||
if(Screen.orientation == ScreenOrientation.Portrait)
|
||||
{
|
||||
this.gameObject.transform.GetChild(0).gameObject.SetActive(false);
|
||||
}
|
||||
if(Screen.orientation == ScreenOrientation.PortraitUpsideDown)
|
||||
{
|
||||
this.gameObject.transform.GetChild(0).gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
if(Screen.orientation == ScreenOrientation.LandscapeLeft)
|
||||
{
|
||||
this.gameObject.transform.GetChild(1).gameObject.SetActive(false);
|
||||
}
|
||||
if(Screen.orientation == ScreenOrientation.LandscapeRight)
|
||||
{
|
||||
this.gameObject.transform.GetChild(1).gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/AdManager/OrientationChecker.cs.meta
Normal file
11
Assets/AdManager/OrientationChecker.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8edac5a1785d6478f9686aa5c11af342
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
1512
Assets/AdManager/SampleSplash.unity
Normal file
1512
Assets/AdManager/SampleSplash.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/AdManager/SampleSplash.unity.meta
Normal file
7
Assets/AdManager/SampleSplash.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44e6fb8e196634fd9811bc2b99afe80e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
63
Assets/AdManager/SampleSplashSettings.lighting
Normal file
63
Assets/AdManager/SampleSplashSettings.lighting
Normal file
@@ -0,0 +1,63 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!850595691 &4890085278179872738
|
||||
LightingSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: SampleSplashSettings
|
||||
serializedVersion: 3
|
||||
m_GIWorkflowMode: 1
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 0
|
||||
m_RealtimeEnvironmentLighting: 1
|
||||
m_BounceScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_UsingShadowmask: 0
|
||||
m_BakeBackend: 0
|
||||
m_LightmapMaxSize: 1024
|
||||
m_BakeResolution: 50
|
||||
m_Padding: 2
|
||||
m_TextureCompression: 0
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 0
|
||||
m_CompAOExponentDirect: 0
|
||||
m_ExtractAO: 0
|
||||
m_MixedBakeMode: 1
|
||||
m_LightmapsBakeMode: 1
|
||||
m_FilterMode: 1
|
||||
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_RealtimeResolution: 1
|
||||
m_ForceWhiteAlbedo: 0
|
||||
m_ForceUpdates: 0
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherRayCount: 1024
|
||||
m_FinalGatherFiltering: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_PVRBounces: 2
|
||||
m_PVRMinBounces: 2
|
||||
m_PVREnvironmentMIS: 0
|
||||
m_PVRFilteringMode: 0
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
8
Assets/AdManager/SampleSplashSettings.lighting.meta
Normal file
8
Assets/AdManager/SampleSplashSettings.lighting.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9344c1d5e5b343df9fa109013107463
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 4890085278179872738
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
37
Assets/AdManager/ShowReward.cs
Normal file
37
Assets/AdManager/ShowReward.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ShowReward : MonoBehaviour
|
||||
{
|
||||
public Text Result;
|
||||
bool sdkinitialize;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
Result.text="Loaded";
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if(PlayerPrefs.GetInt ("reward", 0)==1){
|
||||
Result.text="Congratulation you got your reward";
|
||||
PlayerPrefs.SetInt ("reward", 0);
|
||||
Invoke("ClearText",10f);
|
||||
}else if(PlayerPrefs.GetInt ("reward", 0)==2){
|
||||
Result.text="Sorry! Video failed to load";
|
||||
PlayerPrefs.SetInt ("reward", 0);
|
||||
Invoke("ClearText",10f);
|
||||
}
|
||||
// if(AdManager._Instance.intestetialloaded){
|
||||
// Result.text="Intestetial Loaded";
|
||||
// }
|
||||
}
|
||||
|
||||
void ClearText(){
|
||||
// Result.text=" ";
|
||||
}
|
||||
}
|
||||
11
Assets/AdManager/ShowReward.cs.meta
Normal file
11
Assets/AdManager/ShowReward.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c981a36da6f6462eb7864282dec856e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
83
Assets/AdManager/TW_AdsManager.cs
Executable file
83
Assets/AdManager/TW_AdsManager.cs
Executable file
@@ -0,0 +1,83 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TW_AdsManager : MonoBehaviour
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
public void RequestBanner()
|
||||
{
|
||||
// AdManager._Instance.RequestBanner();
|
||||
}
|
||||
|
||||
public void DestroyBanner()
|
||||
{
|
||||
// AdManager._Instance.DestroyBanner();
|
||||
}
|
||||
|
||||
public void ShowBanner()
|
||||
{
|
||||
AdManager._Instance.ShowBanner();
|
||||
}
|
||||
|
||||
public void HideBanner()
|
||||
{
|
||||
AdManager._Instance.HideBanner();
|
||||
}
|
||||
//End of Banner
|
||||
|
||||
public void RequestNative()
|
||||
{
|
||||
// AdManager._Instance.RequestNative();
|
||||
}
|
||||
|
||||
public void DestroyNative()
|
||||
{
|
||||
// AdManager._Instance.DestroyNative();
|
||||
}
|
||||
|
||||
public void ShowNative()
|
||||
{
|
||||
AdManager._Instance.ShowMRec();
|
||||
}
|
||||
|
||||
public void HideNative()
|
||||
{
|
||||
AdManager._Instance.HideMRec();
|
||||
}
|
||||
//End of Banner
|
||||
|
||||
//Everything about Interstitial
|
||||
public void RequestInterstitial()
|
||||
{
|
||||
// AdManager._Instance.RequestInterstitial();
|
||||
}
|
||||
|
||||
public void ShowInterstitial()
|
||||
{
|
||||
AdManager._Instance.ShowInterstitial();
|
||||
}
|
||||
//End of Interstitial
|
||||
|
||||
public void RequestRewarded()
|
||||
{
|
||||
// AdManager._Instance.RequestRewarded();
|
||||
}
|
||||
|
||||
public void ShowRewardedVideo(){
|
||||
AdManager._Instance.showRewardedVideo();
|
||||
}
|
||||
|
||||
public void MediationDebugger(){
|
||||
AdManager._Instance.MediationDebugger();
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/AdManager/TW_AdsManager.cs.meta
Normal file
11
Assets/AdManager/TW_AdsManager.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5370aa0cd3afb4528976248123f8912a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/AdManager/ad break-LandScape.png
Normal file
BIN
Assets/AdManager/ad break-LandScape.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
132
Assets/AdManager/ad break-LandScape.png.meta
Normal file
132
Assets/AdManager/ad break-LandScape.png.meta
Normal file
@@ -0,0 +1,132 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6dd9436829aa43ecb6408b08cb898fd
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Android
|
||||
maxTextureSize: 1024
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 29
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: c30341c17555d4b6080759d23634dfd0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
21
Assets/AdManager/adInitialize.cs
Normal file
21
Assets/AdManager/adInitialize.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class adInitialize : MonoBehaviour
|
||||
{
|
||||
public Object AdManagerPrefb;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
GameObject Ads=GameObject.Find("AdManager(Clone)");
|
||||
if(Ads==null)
|
||||
Ads=Instantiate(AdManagerPrefb) as GameObject;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
11
Assets/AdManager/adInitialize.cs.meta
Normal file
11
Assets/AdManager/adInitialize.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5510446fff21946f7a51cf3f88d7035c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/AdManager/iOS 14 Advertising Support.meta
Normal file
8
Assets/AdManager/iOS 14 Advertising Support.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 13d079021a7144bce9309ba248e6fede
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/AdManager/iOS 14 Advertising Support/1.2.0.meta
Normal file
8
Assets/AdManager/iOS 14 Advertising Support/1.2.0.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d21ad7137932e47db91cc3279290245b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 720c9fb658ad34be19118f5c027401a0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,307 @@
|
||||
%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_IndirectSpecularColor: {r: 0.3731193, g: 0.38073996, b: 0.3587269, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 11
|
||||
m_GIWorkflowMode: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
m_IndirectOutputScale: 1
|
||||
m_AlbedoBoost: 1
|
||||
m_EnvironmentLightingMode: 0
|
||||
m_EnableBakedLightmaps: 1
|
||||
m_EnableRealtimeLightmaps: 1
|
||||
m_LightmapEditorSettings:
|
||||
serializedVersion: 10
|
||||
m_Resolution: 2
|
||||
m_BakeResolution: 40
|
||||
m_AtlasSize: 1024
|
||||
m_AO: 0
|
||||
m_AOMaxDistance: 1
|
||||
m_CompAOExponent: 1
|
||||
m_CompAOExponentDirect: 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: 500
|
||||
m_PVRBounces: 2
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ShowResolutionOverlay: 1
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_UseShadowmask: 1
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
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
|
||||
accuratePlacement: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &1246526937
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1246526939}
|
||||
- component: {fileID: 1246526938}
|
||||
m_Layer: 0
|
||||
m_Name: Context Screen Sample
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1246526938
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1246526937}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f0c6ccc637064b31981616bfc724dcb, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
contextScreenPrefab: {fileID: 114597661633457500, guid: fa79c615e83e14e2fbc0f083dee317e0,
|
||||
type: 3}
|
||||
--- !u!4 &1246526939
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1246526937}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1438000399
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1438000402}
|
||||
- component: {fileID: 1438000401}
|
||||
- component: {fileID: 1438000400}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &1438000400
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1438000399}
|
||||
m_Enabled: 1
|
||||
--- !u!20 &1438000401
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1438000399}
|
||||
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_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_GateFitMode: 2
|
||||
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!4 &1438000402
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1438000399}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &1719777655
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1719777658}
|
||||
- component: {fileID: 1719777657}
|
||||
- component: {fileID: 1719777656}
|
||||
m_Layer: 0
|
||||
m_Name: EventSystem
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &1719777656
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1719777655}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalAxis: Horizontal
|
||||
m_VerticalAxis: Vertical
|
||||
m_SubmitButton: Submit
|
||||
m_CancelButton: Cancel
|
||||
m_InputActionsPerSecond: 10
|
||||
m_RepeatDelay: 0.5
|
||||
m_ForceModuleActive: 0
|
||||
--- !u!114 &1719777657
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1719777655}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_FirstSelected: {fileID: 0}
|
||||
m_sendNavigationEvents: 1
|
||||
m_DragThreshold: 10
|
||||
--- !u!4 &1719777658
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1719777655}
|
||||
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_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a2154acf9dc1c46e5a8df649580ad6b9
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b456238a0d67d4fe7a23ceab3419966b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fa79c615e83e14e2fbc0f083dee317e0
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 896c313e1acc747f5a75a4e2b2aabe33
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.Advertisement.IosSupport.Samples
|
||||
{
|
||||
[ExecuteInEditMode]
|
||||
public class AutoSwitchLayout : MonoBehaviour
|
||||
{
|
||||
public Transform portraitModeLayoutTransform;
|
||||
public Transform landscapeModeLayoutTransform;
|
||||
|
||||
float m_PreviousAspectRatio;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
var aspectRatio = 1f * Screen.width / Screen.height;
|
||||
|
||||
if (!Mathf.Approximately(aspectRatio, m_PreviousAspectRatio)
|
||||
&& portraitModeLayoutTransform
|
||||
&& landscapeModeLayoutTransform)
|
||||
{
|
||||
m_PreviousAspectRatio = aspectRatio;
|
||||
|
||||
if (aspectRatio > 1f)
|
||||
{
|
||||
landscapeModeLayoutTransform.gameObject.SetActive(true);
|
||||
portraitModeLayoutTransform.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
portraitModeLayoutTransform.gameObject.SetActive(true);
|
||||
landscapeModeLayoutTransform.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c9a84136181c491fa22c727d7e4831a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,41 @@
|
||||
using Unity.Advertisement.IosSupport.Components;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using UnityEngine.iOS;
|
||||
|
||||
namespace Unity.Advertisement.IosSupport.Samples
|
||||
{
|
||||
/// <summary>
|
||||
/// This component will trigger the context screen to appear when the scene starts,
|
||||
/// if the user hasn't already responded to the iOS tracking dialog.
|
||||
/// </summary>
|
||||
public class ContextScreenManager : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// The prefab that will be instantiated by this component.
|
||||
/// The prefab has to have an ContextScreenView component on its root GameObject.
|
||||
/// </summary>
|
||||
public ContextScreenView contextScreenPrefab;
|
||||
|
||||
void Start()
|
||||
{
|
||||
#if UNITY_IOS
|
||||
// check with iOS to see if the user has accepted or declined tracking
|
||||
// var status = ATTrackingStatusBinding.GetAuthorizationTrackingStatus();
|
||||
Version currentVersion = new Version(Device.systemVersion);
|
||||
Version ios14 = new Version("14.5");
|
||||
|
||||
// if (status == ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED && currentVersion >= ios14)
|
||||
{
|
||||
var contextScreen = Instantiate(contextScreenPrefab).GetComponent<ContextScreenView>();
|
||||
|
||||
// after the Continue button is pressed, and the tracking request
|
||||
// has been sent, automatically destroy the popup to conserve memory
|
||||
contextScreen.sentTrackingAuthorizationRequest += () => Destroy(contextScreen.gameObject);
|
||||
}
|
||||
#else
|
||||
Debug.Log("Unity iOS Support: App Tracking Transparency status not checked, because the platform is not iOS.");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f0c6ccc637064b31981616bfc724dcb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.Advertisement.IosSupport.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// This component controls an iOS App Tracking Transparency context screen.
|
||||
/// You should only have one of these in your app.
|
||||
/// </summary>
|
||||
public sealed class ContextScreenView : MonoBehaviour
|
||||
{
|
||||
/// <summary>
|
||||
/// This event will be invoked after the ContinueButton is clicked
|
||||
/// and after the tracking authorization request has been sent.
|
||||
/// It's a good idea to subscribe to this event so you can destroy
|
||||
/// this GameObject to free up memory after it's no longer needed.
|
||||
/// Once the tracking authorization request has been sent, there's no
|
||||
/// need for this popup again until the app is uninstalled and reinstalled.
|
||||
/// </summary>
|
||||
public event Action sentTrackingAuthorizationRequest;
|
||||
|
||||
public void RequestAuthorizationTracking()
|
||||
{
|
||||
#if UNITY_IOS
|
||||
Debug.Log("Unity iOS Support: Requesting iOS App Tracking Transparency native dialog.");
|
||||
|
||||
// ATTrackingStatusBinding.RequestAuthorizationTracking(AuthorizationTrackingReceived);
|
||||
|
||||
sentTrackingAuthorizationRequest?.Invoke();
|
||||
#else
|
||||
Debug.LogWarning("Unity iOS Support: Tried to request iOS App Tracking Transparency native dialog, " +
|
||||
"but the current platform is not iOS.");
|
||||
#endif
|
||||
}
|
||||
|
||||
private void AuthorizationTrackingReceived(int status) {
|
||||
Debug.LogFormat("Tracking status received: {0}", status);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 43c0833ba503546f1906839450d99850
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b74174c3c3f684ed78e93999053406ff
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,121 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2f30a9623bbb145b9b7b5d7b407fa074
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 0
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 9, y: 9, z: 9, w: 9}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 0
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 1627ea3b75cce4b52859e9f762c0729f
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,88 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee2dff451a6a94136a1bc2034d68cb1b
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: -1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 57f1d745d132f4e848cc9acdcf95e3bd
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user