Compare commits
No commits in common. "master" and "v.1.3.7_ios" have entirely different histories.
master
...
v.1.3.7_io
@ -1,195 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BFEditor.Build
|
||||
{
|
||||
public class CompareAssetBundleWindow : EditorWindow
|
||||
{
|
||||
private string newestABPath = "";
|
||||
private string lastABPath = "";
|
||||
public bool IsAndroid = true;
|
||||
private List<string> ABList = new List<string>();
|
||||
Vector2 resultScrollPos;
|
||||
public CompareAssetBundleWindow()
|
||||
{
|
||||
titleContent = new GUIContent("AssetBundle对比");
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
GetNewestABPath();
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
GUILayout.Space(18);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("当前版本AB路径");
|
||||
GUILayout.TextField(newestABPath, GUILayout.Width(600));
|
||||
if (GUILayout.Button("选择", GUILayout.Width(80)))
|
||||
{
|
||||
string openPath = EditorUtility.OpenFolderPanel("select ab path", newestABPath, "");
|
||||
if (openPath.CompareTo("") != 0){
|
||||
newestABPath = openPath;
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(10);
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("上个版本AB路径");
|
||||
GUILayout.TextField(lastABPath, GUILayout.Width(600));
|
||||
if (GUILayout.Button("选择", GUILayout.Width(80)))
|
||||
{
|
||||
string openPath = EditorUtility.OpenFolderPanel("select ab path", lastABPath, "");
|
||||
if (openPath.CompareTo("") != 0){
|
||||
lastABPath = openPath;
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(10);
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Space(150);
|
||||
if (GUILayout.Button("对比", GUILayout.Width(200), GUILayout.Height(40)))
|
||||
{
|
||||
CheckMD5AndAssetHash();
|
||||
}
|
||||
|
||||
GUILayout.Space(100);
|
||||
if (GUILayout.Button("使用上个版本的AB修复", GUILayout.Width(200), GUILayout.Height(40)))
|
||||
{
|
||||
UseLastABFix();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(30);
|
||||
|
||||
DrawResult();
|
||||
}
|
||||
|
||||
private void DrawResult()
|
||||
{
|
||||
resultScrollPos = GUILayout.BeginScrollView(resultScrollPos, GUILayout.Width(800), GUILayout.Height(620));
|
||||
for (int i = ABList.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var path = ABList[i];
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Space(20);
|
||||
EditorGUILayout.TextField(path);
|
||||
|
||||
GUILayout.Space(10);
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
GUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void CheckMD5AndAssetHash()
|
||||
{
|
||||
if (string.IsNullOrEmpty(newestABPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(lastABPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
ABList.Clear();
|
||||
var manifestPath = System.IO.Path.Combine(newestABPath, "asset_bundle_manifest.ab");
|
||||
var manifestAB = AssetBundle.LoadFromFile(manifestPath);
|
||||
var Manifest = manifestAB.LoadAsset<AssetBundleManifest>("AssetBundleManifest");
|
||||
manifestAB.Unload(false);
|
||||
|
||||
var lastManifestPath = System.IO.Path.Combine(lastABPath, "asset_bundle_manifest.ab");
|
||||
var lastManifestAB = AssetBundle.LoadFromFile(lastManifestPath);
|
||||
var lastManifest = lastManifestAB.LoadAsset<AssetBundleManifest>("AssetBundleManifest");
|
||||
lastManifestAB.Unload(false);
|
||||
|
||||
var allAB = Manifest.GetAllAssetBundles();
|
||||
foreach(var path in allAB)
|
||||
{
|
||||
if (path.Contains("ab_config.bytes") || path.Contains("asset_bundle_manifest.ab"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var fullPathA = Path.Combine(newestABPath, path);
|
||||
var fullPathB = Path.Combine(lastABPath, path);
|
||||
if (File.Exists(fullPathB) && BF.GameLaunchUtils.GetFileMD5(fullPathA).CompareTo(BF.GameLaunchUtils.GetFileMD5(fullPathB)) != 0)
|
||||
{
|
||||
if (Manifest.GetAssetBundleHash(path) == lastManifest.GetAssetBundleHash(path))
|
||||
{
|
||||
// md5 不一致但是AssetHash一致的情况
|
||||
ABList.Add(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UseLastABFix()
|
||||
{
|
||||
if (string.IsNullOrEmpty(newestABPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(lastABPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (ABList.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach(var path in ABList)
|
||||
{
|
||||
var fullPathA = Path.Combine(newestABPath, path);
|
||||
var fullPathB = Path.Combine(lastABPath, path);
|
||||
File.Copy(fullPathB, fullPathA, true);
|
||||
}
|
||||
var version = newestABPath.Substring(newestABPath.Replace("\\", "/").LastIndexOf("/") + 1);
|
||||
AssetBundleUtils.RegenerateABConfigMd5(newestABPath, version);
|
||||
|
||||
ABList.Clear();
|
||||
}
|
||||
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<CompareAssetBundleWindow>();
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void GetNewestABPath()
|
||||
{
|
||||
var bundleCachePath = IsAndroid ? Application.dataPath + "/../HistoryAssetBundles" : Application.dataPath + "/../HistoryAssetBundles/IOS";
|
||||
var dirInfo = new DirectoryInfo(bundleCachePath);
|
||||
var dirs = dirInfo.GetDirectories();
|
||||
if (dirs.Length == 0)
|
||||
{
|
||||
newestABPath = "";
|
||||
lastABPath = "";
|
||||
}
|
||||
if (dirs.Length == 1)
|
||||
{
|
||||
newestABPath = dirs[0].FullName;
|
||||
lastABPath = "";
|
||||
}
|
||||
var hightestIndex = 0;
|
||||
var secondIndex = 0;
|
||||
for (var i = 1; i < dirs.Length; i++)
|
||||
{
|
||||
if (dirs[i].FullName.CompareTo(dirs[hightestIndex].FullName) > 0)
|
||||
{
|
||||
secondIndex = hightestIndex;
|
||||
hightestIndex = i;
|
||||
}
|
||||
}
|
||||
newestABPath = dirs[hightestIndex].FullName;
|
||||
if (hightestIndex > 0)
|
||||
{
|
||||
lastABPath = dirs[secondIndex].FullName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -192,34 +192,10 @@ namespace BFEditor.Build
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("打包工具/AssetBundles/对比上一个版本AB Android", priority = 207)]
|
||||
static void CompareLastVersionABAndroid()
|
||||
{
|
||||
var window = (CompareAssetBundleWindow)EditorWindow.GetWindowWithRect(typeof(CompareAssetBundleWindow),
|
||||
new Rect(Screen.width / 2, Screen.height / 2, 800, 800), true);
|
||||
window.IsAndroid = true;
|
||||
window.Show();
|
||||
}
|
||||
|
||||
[MenuItem("打包工具/AssetBundles/对比上一个版本AB IOS", priority = 208)]
|
||||
static void CompareLastVersionABIOS()
|
||||
{
|
||||
var window = (CompareAssetBundleWindow)EditorWindow.GetWindowWithRect(typeof(CompareAssetBundleWindow),
|
||||
new Rect(Screen.width / 2, Screen.height / 2, 800, 800), true);
|
||||
window.IsAndroid = false;
|
||||
window.Show();
|
||||
}
|
||||
|
||||
[MenuItem("打包工具/打包窗口", priority = 301)]
|
||||
static void ShowBuildWindow()
|
||||
{
|
||||
BuildProjectWindow.ShowWindow();
|
||||
}
|
||||
|
||||
[MenuItem("打包工具/Android转换为AAB工程", priority = 401)]
|
||||
static void ConvertAndroidStudioToAAB()
|
||||
{
|
||||
BuildAndroidUtils.ConvertToAAB();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,8 +13,6 @@ namespace BFEditor.Build
|
||||
|
||||
public class BuildProjectWindow : EditorWindow
|
||||
{
|
||||
private static int versionCode = 18;
|
||||
private static string versionName = "1.6.5";
|
||||
BFPlatformOptions platform = BFPlatformOptions.AndroidDev;
|
||||
const string ANDROID_DEV_PACKAGE_NAME = "com.juzu.b6.dev.android";
|
||||
const string ANDROID_RELEASE_PACKAGE_NAME = "com.juzu.b6.release.android";
|
||||
@ -36,7 +34,7 @@ namespace BFEditor.Build
|
||||
platform = (BFPlatformOptions)EditorGUILayout.EnumPopup("", platform);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.LabelField("版本: " + versionName);
|
||||
EditorGUILayout.LabelField("版本: 0.1.0");
|
||||
EditorGUILayout.Space();
|
||||
|
||||
string packageName;
|
||||
@ -72,8 +70,7 @@ namespace BFEditor.Build
|
||||
if (GUILayout.Button("一键打包"))
|
||||
{
|
||||
var buildInfo = new BuildInfo();
|
||||
buildInfo.version = versionName;
|
||||
buildInfo.version_code = versionCode;
|
||||
buildInfo.version = "0.1.0";
|
||||
buildInfo.mode = mode;
|
||||
buildInfo.bundleName = packageName;
|
||||
buildInfo.skipVersion = skipVersion;
|
||||
|
||||
@ -3,7 +3,6 @@ using UnityEditor;
|
||||
using System.IO;
|
||||
using UnityEditor.Build.Reporting;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
@ -30,14 +29,8 @@ namespace BFEditor.Build
|
||||
static string GoogleCommonProjectPath = Application.dataPath + "/../BFVersions/android/google_common";
|
||||
static string GPAsProjectPath = Application.dataPath + "/../BFVersions/android/ub-gp"; // gp删档测试渠道
|
||||
static string GPOfficialAsProjectPath = Application.dataPath + "/../BFVersions/android/ub-google"; // gp正式渠道
|
||||
static string PublishAsProjectPath = Application.dataPath + "/../BFVersions/android/publish_release";
|
||||
static string SignShellPath = Application.dataPath + "/../BFFiles/androidkey";
|
||||
static string GpAlginShellPath = Application.dataPath + "/../BFFiles/androidkey";
|
||||
static HashSet<string> AABInPackageFileHashSet = new HashSet<string>()
|
||||
{
|
||||
"bin",
|
||||
"UnityServicesProjectConfiguration.json"
|
||||
};
|
||||
|
||||
static BuildAndroidUtils()
|
||||
{
|
||||
@ -289,7 +282,6 @@ namespace BFEditor.Build
|
||||
else if(buildInfo.IsGPChannel())
|
||||
{
|
||||
MergeProject(buildInfo, GoogleAsProjectPath);
|
||||
FixGradleVersion(buildInfo.version_code, buildInfo.version);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -399,19 +391,13 @@ namespace BFEditor.Build
|
||||
static void FixGradleVersion(int versionCode, string versionName)
|
||||
{
|
||||
Debug.Log("[bfinfo]修正build.gradle: VersionCode " + versionCode + " VersionName " + versionName);
|
||||
var gradleFilePath = Path.Combine(PublishAsProjectPath, "launcher", "build.gradle");
|
||||
var gradleFilePath = Path.Combine(GradleExcuteProjectPath, "build.gradle");
|
||||
var text = File.ReadAllText(gradleFilePath);
|
||||
var regex = new Regex("versionCode 1");
|
||||
text = regex.Replace(text, string.Format("versionCode {0}", versionCode));
|
||||
var regex2 = new Regex("versionName '0.1.0'");
|
||||
text = regex2.Replace(text, string.Format("versionName '{0}'", versionName));
|
||||
regex = new Regex("versionName '0.1'");
|
||||
text = regex.Replace(text, string.Format("versionName '{0}'", versionName));
|
||||
File.WriteAllText(gradleFilePath, text);
|
||||
|
||||
var gradleFilePath2 = Path.Combine(PublishAsProjectPath, "unityLibrary", "build.gradle");
|
||||
var text2 = File.ReadAllText(gradleFilePath2);
|
||||
text2 = regex.Replace(text2, string.Format("versionCode {0}", versionCode));
|
||||
text2 = regex2.Replace(text2, string.Format("versionName '{0}'", versionName));
|
||||
File.WriteAllText(gradleFilePath2, text2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -557,77 +543,5 @@ namespace BFEditor.Build
|
||||
tmp.Abort();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ConvertToAAB()
|
||||
{
|
||||
var installTimePackDirPath = Path.Combine(PublishAsProjectPath, "../", "dz_google_abb", "install_time_pack");
|
||||
var targetDirPath = Path.Combine(PublishAsProjectPath, "install_time_pack");
|
||||
if (Directory.Exists(targetDirPath))
|
||||
{
|
||||
Directory.Delete(targetDirPath, true);
|
||||
Directory.CreateDirectory(targetDirPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
Directory.CreateDirectory(targetDirPath);
|
||||
}
|
||||
|
||||
BFEditorUtils.CopyDir(installTimePackDirPath, targetDirPath);
|
||||
|
||||
var abDirPath = Path.Combine(PublishAsProjectPath, "unityLibrary/src/main/assets");
|
||||
var destFolderName = Path.Combine(PublishAsProjectPath, "install_time_pack/src/main/assets");
|
||||
var dirInfo = new DirectoryInfo(abDirPath);
|
||||
var floders = dirInfo.GetDirectories();
|
||||
for (var i = 0; i < floders.Length; i++)
|
||||
{
|
||||
if (AABInPackageFileHashSet.Contains(floders[i].Name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var newDir = Path.Combine(destFolderName, floders[i].Name);
|
||||
if (!Directory.Exists(newDir))
|
||||
{
|
||||
Directory.CreateDirectory(newDir);
|
||||
}
|
||||
BFEditorUtils.CopyDir(floders[i].FullName, newDir);
|
||||
Directory.Delete(floders[i].FullName, true);
|
||||
}
|
||||
|
||||
var files = dirInfo.GetFiles();
|
||||
for (var i = 0; i < files.Length; i++)
|
||||
{
|
||||
var file = files[i];
|
||||
if (AABInPackageFileHashSet.Contains(file.Name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var destFile = Path.Combine(destFolderName, file.Name);
|
||||
if (File.Exists(destFile))
|
||||
{
|
||||
File.Delete(destFile);
|
||||
}
|
||||
File.Move(file.FullName, destFile);
|
||||
}
|
||||
|
||||
var settingsGradleFilePath = Path.Combine(PublishAsProjectPath, "settings.gradle");
|
||||
var text = File.ReadAllText(settingsGradleFilePath);
|
||||
var appendText = "include ':install_time_pack'";
|
||||
if (!text.EndsWith(appendText))
|
||||
{
|
||||
text = text + "\n" + appendText;
|
||||
}
|
||||
File.WriteAllText(settingsGradleFilePath, text);
|
||||
|
||||
var buildGradlePath = Path.Combine(PublishAsProjectPath, "launcher/build.gradle");
|
||||
var buildGradleText = File.ReadAllText(buildGradlePath);
|
||||
var regex2 = new Regex("assetPacks = [\":install_time_pack\"]");
|
||||
if (!regex2.IsMatch(buildGradleText))
|
||||
{
|
||||
var regex22 = new Regex("android {");
|
||||
buildGradleText = regex22.Replace(buildGradleText, "android {\n assetPacks = [\":install_time_pack\"]");
|
||||
}
|
||||
File.WriteAllText(buildGradlePath, buildGradleText);
|
||||
Debug.Log("Android转换为AAB工程完成");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,25 +20,18 @@ namespace BFEditor
|
||||
// }
|
||||
const string BOARD_EXCEL_KEY = "bf_board_excel_key";
|
||||
const string BOARD_GRID_TYPE_KEY = "bf_board_grid_type_key";
|
||||
const string BOARD_GRID_EDGE_KEY = "bf_board_grid_edge_key";
|
||||
int gridCount = 49;
|
||||
string battleImgDirectory = "Assets/arts/textures/ui/battle/";
|
||||
string boardFilepath;
|
||||
string boardGridTypePath;
|
||||
string boardGridEdgePath;
|
||||
string boardFiledName = "board";
|
||||
string boardEdgeFiledName = "grid_edge";
|
||||
string randomTypeStr = "";
|
||||
string boardEdgeStr = "";
|
||||
int curIndex = 1;
|
||||
int maxRow = 7;
|
||||
Dictionary<int, Dictionary<string, string>> boardGridTypeDict = new Dictionary<int, Dictionary<string, string>>();
|
||||
Dictionary<int, JArray> boardDict = new Dictionary<int, JArray>();
|
||||
Dictionary<int, JArray> outPutBoardDict = new Dictionary<int, JArray>();
|
||||
Dictionary<string, Texture> imgDict = new Dictionary<string, Texture>();
|
||||
Dictionary<int, Dictionary<string, string>> boardGridEdgeDict = new Dictionary<int, Dictionary<string, string>>();
|
||||
Dictionary<int, JArray> edgeDict = new Dictionary<int, JArray>();
|
||||
Dictionary<int, JArray> outPutBoardEdgeDict = new Dictionary<int, JArray>();
|
||||
bool loadExcelOver = false;
|
||||
Dictionary<int, string> elementTypeImgDict = new Dictionary<int, string>(){
|
||||
[1] = "red_1",
|
||||
@ -62,12 +55,6 @@ namespace BFEditor
|
||||
{
|
||||
boardGridTypePath = "选择grid_type配置表路径";
|
||||
}
|
||||
|
||||
boardGridEdgePath = GetBoardGridEdgePath();
|
||||
if (boardGridEdgePath.Equals(""))
|
||||
{
|
||||
boardGridEdgePath = "选择grid_edge_type配置表路径";
|
||||
}
|
||||
string[] paths = Directory.GetFiles(battleImgDirectory);
|
||||
foreach(var path in paths)
|
||||
{
|
||||
@ -99,16 +86,6 @@ namespace BFEditor
|
||||
PlayerPrefs.SetString(BOARD_GRID_TYPE_KEY, path);
|
||||
}
|
||||
|
||||
string GetBoardGridEdgePath()
|
||||
{
|
||||
return PlayerPrefs.GetString(BOARD_GRID_EDGE_KEY, "");
|
||||
}
|
||||
|
||||
void SetBoardGridEdgePath(string path)
|
||||
{
|
||||
PlayerPrefs.SetString(BOARD_GRID_EDGE_KEY, path);
|
||||
}
|
||||
|
||||
BoardEditorWindow()
|
||||
{
|
||||
this.titleContent = new GUIContent("棋盘编辑器");
|
||||
@ -137,20 +114,6 @@ namespace BFEditor
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("grid_edge 路径", GUILayout.Width(100));
|
||||
GUILayout.Space(10);
|
||||
GUILayout.TextField(boardGridEdgePath, GUILayout.Width(300));
|
||||
if (GUILayout.Button("选择", GUILayout.Width(80)))
|
||||
{
|
||||
string openPath = EditorUtility.OpenFilePanel("选择配置表", GetBoardGridEdgePath(), "");
|
||||
if (openPath.CompareTo("") != 0)
|
||||
{
|
||||
boardGridEdgePath = openPath;
|
||||
SetBoardGridEdgePath(openPath);
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.Space(10);
|
||||
GUILayout.BeginHorizontal();
|
||||
@ -342,74 +305,6 @@ namespace BFEditor
|
||||
boardDict[curIndex] = ja;
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.EndArea();
|
||||
GUILayout.BeginArea(new Rect(730, 650, 500, 500));
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Label("棋盘边缘元素");
|
||||
boardEdgeStr = GUILayout.TextField(boardEdgeStr, GUILayout.Width(400), GUILayout.Height(100));
|
||||
if(GUILayout.Button("加载边缘元素配置", GUILayout.Width(110)))
|
||||
{
|
||||
JArray edgeJo = edgeDict[curIndex];
|
||||
string str = "[";
|
||||
for (int i = 0; i < edgeJo.Count; i++)
|
||||
{
|
||||
JArray gridInfo = (JArray)edgeJo[i];
|
||||
if (gridInfo.Count < 3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
string s = "{";
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
s = s + gridInfo[j].ToString();
|
||||
if(j != 2)
|
||||
{
|
||||
s = s + ", ";
|
||||
}
|
||||
}
|
||||
s = s + "}";
|
||||
str = str + s;
|
||||
if (i != edgeJo.Count)
|
||||
{
|
||||
str = str + ", ";
|
||||
}
|
||||
}
|
||||
boardEdgeStr = str;
|
||||
}
|
||||
if(GUILayout.Button("重新刷新边缘元素", GUILayout.Width(110)))
|
||||
{
|
||||
string[] units = boardEdgeStr.Split('{');
|
||||
List<string> edgeList = new List<string>();
|
||||
for (int i = 0; i < units.Length; i++)
|
||||
{
|
||||
string formatStr = units[i].Replace("[", "").Replace("]", "").Replace(" ", "").Replace("}", "");
|
||||
string[] unitList = formatStr.Split(',');
|
||||
if (unitList.Length >= 3)
|
||||
{
|
||||
string str = "[";
|
||||
for(int j = 0; j < 3; j++)
|
||||
{
|
||||
str = str + unitList[j];
|
||||
if (j != 2)
|
||||
{
|
||||
str = str + ",";
|
||||
}
|
||||
}
|
||||
str = str + "]";
|
||||
edgeList.Add(str);
|
||||
}
|
||||
}
|
||||
|
||||
JArray ja = new JArray();
|
||||
for (int i = 0; i < edgeList.Count; i++)
|
||||
{
|
||||
JArray unit = (JArray)JsonConvert.DeserializeObject(edgeList[i]);
|
||||
ja.Add(unit);
|
||||
}
|
||||
edgeDict[curIndex] = ja;
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.EndArea();
|
||||
if(GUI.Button(new Rect(1050, 10, 100, 30), "导出到Excel"))
|
||||
{
|
||||
@ -462,21 +357,6 @@ namespace BFEditor
|
||||
boardGridTypeDict[key] = dict;
|
||||
}
|
||||
|
||||
// 读取grid_edge_type配置表
|
||||
BFEditorUtils.RunCommond("python", "load_board.py " + tempPath + " " + boardGridEdgePath, pythonToolPath);
|
||||
string boardGridEdgeJson = File.ReadAllText(tempPath);
|
||||
jsonObj = (JObject)JsonConvert.DeserializeObject(boardGridEdgeJson);
|
||||
foreach (var item in jsonObj)
|
||||
{
|
||||
int key = int.Parse(item.Key);
|
||||
Dictionary<string, string> dict = new Dictionary<string, string>();
|
||||
foreach (var item2 in (JObject)item.Value)
|
||||
{
|
||||
dict[item2.Key] = item2.Value.ToString();
|
||||
}
|
||||
boardGridEdgeDict[key] = dict;
|
||||
}
|
||||
|
||||
// 读取boardFile配置表
|
||||
BFEditorUtils.RunCommond("python", "load_board.py " + tempPath + " " + boardFilepath, pythonToolPath);
|
||||
string boardFileJson = File.ReadAllText(tempPath);
|
||||
@ -489,12 +369,6 @@ namespace BFEditor
|
||||
boardDict[key] = copyBoard((JArray)item.Value[boardFiledName]);
|
||||
outPutBoardDict[key] = copyBoard((JArray)item.Value[boardFiledName]);
|
||||
}
|
||||
if (item.Value[boardEdgeFiledName] != null)
|
||||
{
|
||||
int key = int.Parse(item.Key);
|
||||
edgeDict[key] = copyBoard((JArray)item.Value[boardEdgeFiledName]);
|
||||
outPutBoardEdgeDict[key] = copyBoard((JArray)item.Value[boardEdgeFiledName]);
|
||||
}
|
||||
}
|
||||
|
||||
loadExcelOver = true;
|
||||
@ -520,7 +394,7 @@ namespace BFEditor
|
||||
void DragBoard()
|
||||
{
|
||||
Texture img;
|
||||
GUI.DrawTexture(new Rect(0, 200, 702, 702), boardImg);
|
||||
GUI.DrawTexture(new Rect(0, 150, 702, 702), boardImg);
|
||||
if(!loadExcelOver)
|
||||
{
|
||||
return;
|
||||
@ -532,7 +406,7 @@ namespace BFEditor
|
||||
return;
|
||||
}
|
||||
|
||||
GUILayout.BeginArea(new Rect(0, 200, 702, 702));
|
||||
GUILayout.BeginArea(new Rect(0, 150, 702, 702));
|
||||
GUILayout.BeginVertical();
|
||||
JArray jo = boardDict[curIndex];
|
||||
int posIndex = 0;
|
||||
@ -578,52 +452,9 @@ namespace BFEditor
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
if (edgeDict.ContainsKey(curIndex))
|
||||
{
|
||||
JArray edgeJo = edgeDict[curIndex];
|
||||
for (int i = 0; i < edgeJo.Count; i++)
|
||||
{
|
||||
JArray gridInfo = (JArray)edgeJo[i];
|
||||
if(gridInfo.Count < 3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int posId = (int)gridInfo[0];
|
||||
int edgeType = (int)gridInfo[1];
|
||||
int dir = (int)gridInfo[2];
|
||||
// 绘制类型
|
||||
if(boardGridEdgeDict[edgeType].ContainsKey("icon"))
|
||||
{
|
||||
string icon = boardGridEdgeDict[edgeType]["icon"];
|
||||
if (imgDict.ContainsKey(icon))
|
||||
{
|
||||
int row = posId / 10;
|
||||
int col = posId % 10;
|
||||
img = imgDict[icon];
|
||||
if (dir == 1)
|
||||
{
|
||||
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth, startOffset + (row - 1) * textureWidth - 16, 92, 32), img);
|
||||
}
|
||||
else if (dir == 2)
|
||||
{
|
||||
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth, startOffset + (row - 1) * textureWidth - 16 + textureWidth, 92, 32), img);
|
||||
}
|
||||
else if (dir == 3)
|
||||
{
|
||||
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth - 16, startOffset + (row - 1) * textureWidth - 16, 32, 92), img);
|
||||
}
|
||||
else if (dir == 4)
|
||||
{
|
||||
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth - 16 + textureWidth, startOffset + (row - 1) * textureWidth - 16, 32, 92), img);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GUILayout.EndArea();
|
||||
|
||||
GUILayout.BeginArea(new Rect(730, 200, 510 * 7, 550 / 7 * maxRow));
|
||||
GUILayout.BeginArea(new Rect(730, 150, 510 * 7, 550 / 7 * maxRow));
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("棋盘配置信息", GUILayout.Width(100), GUILayout.Height(30));
|
||||
|
||||
@ -136,17 +136,71 @@ namespace BFEditor
|
||||
var configFileInfos = configDirInfo.GetFiles(suffix, SearchOption.TopDirectoryOnly);
|
||||
|
||||
// 检查棋盘文件格式
|
||||
checkBoard("chapter_board", env, sb);
|
||||
checkBoard("chapter_board_bossrush", env, sb);
|
||||
checkBoard("chapter_board_daily_challenge", env, sb);
|
||||
checkBoard("chapter_board_dungeon_armor", env, sb);
|
||||
checkBoard("chapter_board_dungeon_equip", env, sb);
|
||||
checkBoard("chapter_board_dungeon_gold", env, sb);
|
||||
checkBoard("chapter_board_dungeon_shards", env, sb);
|
||||
checkBoard("chapter_board_rune", env, sb);
|
||||
checkBoard("activity_pvp_board", env, sb);
|
||||
checkBoard("arena_board", env, sb);
|
||||
|
||||
var luaScriptString = @"local cfg = require('app/config/chapter_board')
|
||||
if not cfg or not cfg.data then
|
||||
return ''
|
||||
end
|
||||
cfg = cfg.data
|
||||
local tempMap = {}
|
||||
local addErrorInfo = function(errorInfo, cfgId, errorStr)
|
||||
if not tempMap[cfgId] then
|
||||
tempMap[cfgId] = true
|
||||
table.insert(errorInfo, 'cfgId = ' .. cfgId)
|
||||
end
|
||||
|
||||
table.insert(errorInfo, ' ' .. errorStr)
|
||||
end
|
||||
|
||||
local errorInfo = {}
|
||||
for k, info in pairs(cfg) do
|
||||
local board = info.board
|
||||
if not board then
|
||||
addErrorInfo(errorInfo, k, '没有board字段,请检查')
|
||||
end
|
||||
|
||||
if #board < 49 then
|
||||
addErrorInfo(errorInfo, k, '没有board长度不足,请检查,当前长度为' .. #board)
|
||||
end
|
||||
|
||||
for index, v in ipairs(board) do
|
||||
if not v[1] then
|
||||
addErrorInfo(errorInfo, k, 'board字段中' .. index .. '索引没有格子类型')
|
||||
end
|
||||
if not v[2] then
|
||||
addErrorInfo(errorInfo, k, 'board字段中' .. index .. '索引没有元素类型')
|
||||
end
|
||||
end
|
||||
|
||||
local mystery_box_board = info.mystery_box_board
|
||||
if mystery_box_board then
|
||||
for index, v in ipairs(mystery_box_board) do
|
||||
if not v[1] then
|
||||
addErrorInfo(errorInfo, k, 'mystery_box_board字段中' .. index .. '索引没有格子类型')
|
||||
end
|
||||
if not v[2] then
|
||||
addErrorInfo(errorInfo, k, 'mystery_box_board字段中' .. index .. '索引没有元素类型')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if #errorInfo > 0 then
|
||||
return table.concat(errorInfo, '\n');
|
||||
end
|
||||
|
||||
return ''";
|
||||
var resultStr = env.DoString(luaScriptString);
|
||||
if (resultStr.Length > 0)
|
||||
{
|
||||
foreach(var strObj in resultStr)
|
||||
{
|
||||
var str = Convert.ToString(strObj);
|
||||
if(!String.IsNullOrEmpty(str))
|
||||
{
|
||||
sb.Append(str + "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 检查monster
|
||||
string monsterConfigListLua = "{";
|
||||
@ -159,7 +213,7 @@ namespace BFEditor
|
||||
}
|
||||
}
|
||||
monsterConfigListLua += "}";
|
||||
var luaScriptString = "local ids = {}\n local MONSTER_LIST = " + monsterConfigListLua + "\n";
|
||||
luaScriptString = "local ids = {}\n local MONSTER_LIST = " + monsterConfigListLua + "\n";
|
||||
luaScriptString += @"local str = {}
|
||||
for i, name in ipairs(MONSTER_LIST) do
|
||||
if name ~= 'monster_base' and name ~= 'monster_position' and name ~= 'monster_position_base' then
|
||||
@ -176,7 +230,7 @@ namespace BFEditor
|
||||
return table.concat(str, '\n');
|
||||
end
|
||||
return ''";
|
||||
var resultStr = env.DoString(luaScriptString);
|
||||
resultStr = env.DoString(luaScriptString);
|
||||
if (resultStr.Length > 0)
|
||||
{
|
||||
foreach(var strObj in resultStr)
|
||||
@ -245,76 +299,6 @@ namespace BFEditor
|
||||
return sb;
|
||||
}
|
||||
|
||||
public static void checkBoard(string configName, LuaEnv env, in StringBuilder sb)
|
||||
{
|
||||
var luaScriptString = @"
|
||||
if not cfg or not cfg.data then
|
||||
return ''
|
||||
end
|
||||
cfg = cfg.data
|
||||
local tempMap = {}
|
||||
local addErrorInfo = function(errorInfo, cfgId, errorStr)
|
||||
if not tempMap[cfgId] then
|
||||
tempMap[cfgId] = true
|
||||
table.insert(errorInfo, 'cfgId = ' .. cfgId)
|
||||
end
|
||||
|
||||
table.insert(errorInfo, ' ' .. errorStr)
|
||||
end
|
||||
|
||||
local errorInfo = {}
|
||||
for k, info in pairs(cfg) do
|
||||
local board = info.board or info.board_daily_challenge
|
||||
if not board then
|
||||
addErrorInfo(errorInfo, k, configName .. ' 没有board字段,请检查')
|
||||
else
|
||||
if #board < 49 then
|
||||
addErrorInfo(errorInfo, k, configName .. ' 没有board长度不足,请检查,当前长度为' .. #board)
|
||||
end
|
||||
|
||||
for index, v in ipairs(board) do
|
||||
if not v[1] then
|
||||
addErrorInfo(errorInfo, k, configName .. ' board字段中' .. index .. '索引没有格子类型')
|
||||
end
|
||||
if not v[2] then
|
||||
addErrorInfo(errorInfo, k, configName .. ' board字段中' .. index .. '索引没有元素类型')
|
||||
elseif v[2] > 5 or v[2] < 0 then
|
||||
addErrorInfo(errorInfo, k, configName .. ' board字段中' .. index .. '元素类型不合法,当前为' .. v[2])
|
||||
end
|
||||
end
|
||||
|
||||
local mystery_box_board = info.mystery_box_board
|
||||
if mystery_box_board then
|
||||
for index, v in ipairs(mystery_box_board) do
|
||||
if not v[1] then
|
||||
addErrorInfo(errorInfo, k, configName .. ' mystery_box_board字段中' .. index .. '索引没有格子类型')
|
||||
end
|
||||
if not v[2] then
|
||||
addErrorInfo(errorInfo, k, configName .. ' mystery_box_board字段中' .. index .. '索引没有元素类型')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if #errorInfo > 0 then
|
||||
return table.concat(errorInfo, '\n');
|
||||
end
|
||||
|
||||
return ''";
|
||||
var resultStr = env.DoString(" local cfg = require('app/config/" + configName + "')\n" + "local configName = '" + configName + "'\n" + luaScriptString);
|
||||
if (resultStr.Length > 0)
|
||||
{
|
||||
foreach(var strObj in resultStr)
|
||||
{
|
||||
var str = Convert.ToString(strObj);
|
||||
if(!String.IsNullOrEmpty(str))
|
||||
{
|
||||
sb.Append(str + "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool FastExportExcelToLua(bool isDeveloper, string designExcelPath)
|
||||
{
|
||||
failFlag = false;
|
||||
|
||||
@ -104,7 +104,7 @@ namespace BFEditor
|
||||
[MenuItem("其他工具/棋盘编辑器", false, 9)]
|
||||
public static void CreateBoardEditorWindow()
|
||||
{
|
||||
var window = (BoardEditorWindow)EditorWindow.GetWindowWithRect(typeof(BoardEditorWindow), new Rect(Screen.width / 2, Screen.height / 2, 1200, 1000), true);
|
||||
var window = (BoardEditorWindow)EditorWindow.GetWindowWithRect(typeof(BoardEditorWindow), new Rect(Screen.width / 2, Screen.height / 2, 1200, 850), true);
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,8 +11,8 @@ public class JenkinsAdapter {
|
||||
/// 构建版本号
|
||||
/// </summary>
|
||||
private static string BuildVersion = (int.Parse(DateTime.Now.ToString("yyMMddHH"))).ToString();
|
||||
private static int versionCode = 10;
|
||||
private static string versionName = "1.4.0";
|
||||
private static int versionCode = 9;
|
||||
private static string versionName = "1.3.7";
|
||||
|
||||
[MenuItem("Jenkins/JenkinsBuildIos")]
|
||||
public static void CommandLineBuildIos() {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
BIN
Assets/Plugins/Android/android-bridge.jar
Normal file
BIN
Assets/Plugins/Android/android-bridge.jar
Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f10a601320ff74e1e96ecfd77be278c5
|
||||
guid: cbe75846a2b4da1459371181319ce8e3
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@ -8,28 +8,19 @@
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
maven {
|
||||
url "https://android-sdk.is.com/" // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:9, Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:48, Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:16
|
||||
url "https://android-sdk.is.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9, Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16, Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:16, Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8, Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:8, Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:16, Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:16, Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:16, Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:8, Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8, Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8
|
||||
}
|
||||
maven {
|
||||
url "https://maven.google.com/" // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:17, Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:25, Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:40, Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
||||
url "https://maven.google.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17, Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25, Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8, Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:8, Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:15, Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:15, Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:8, Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:8, Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
||||
}
|
||||
maven {
|
||||
url "https://cboost.jfrog.io/artifactory/chartboost-ads/" // Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:15
|
||||
url "https://repo.maven.apache.org/maven2/" // Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
||||
}
|
||||
maven {
|
||||
url "https://repo.maven.apache.org/maven2/" // Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
||||
url "https://artifact.bytedance.com/repository/pangle/" // Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
||||
}
|
||||
maven {
|
||||
url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/" // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:24, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:32
|
||||
}
|
||||
maven {
|
||||
url "https://artifact.bytedance.com/repository/pangle/" // Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
||||
}
|
||||
maven {
|
||||
url "https://sdk.tapjoy.com/" // Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
||||
}
|
||||
maven {
|
||||
url "https://jitpack.io/" // Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:8
|
||||
url "https://sdk.tapjoy.com/" // Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
||||
}
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
@ -43,50 +34,42 @@ apply plugin: 'com.android.library'
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
// Android Resolver Dependencies Start
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:40
|
||||
implementation 'com.adcolony:sdk:4.8.0' // Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8
|
||||
implementation 'com.adcolony:sdk:4.8.0' // Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8
|
||||
implementation 'com.android.installreferrer:installreferrer:2.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:10
|
||||
implementation 'com.android.support:appcompat-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||
implementation 'com.android.support:cardview-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||
implementation 'com.android.support:customtabs:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||
implementation 'com.android.support:support-v4:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||
implementation 'com.applovin:applovin-sdk:11.10.1' // Assets/ThirdParty/MaxSdk/AppLovin/Editor/Dependencies.xml:4
|
||||
implementation 'com.appsflyer:adrevenue:6.5.4' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerAdRevenueDependencies.xml:4
|
||||
implementation 'com.applovin:applovin-sdk:11.7.1' // Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:15
|
||||
implementation 'com.appsflyer:af-android-sdk:6.4.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:6
|
||||
implementation 'com.appsflyer:unity-adrevenue-generic-wrapper:6.5.4' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerAdRevenueDependencies.xml:5
|
||||
implementation 'com.appsflyer:unity-wrapper:6.4.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:8
|
||||
implementation 'com.chartboost:chartboost-sdk:9.3.1' // Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:15
|
||||
implementation 'com.facebook.android:audience-network-sdk:6.16.0' // Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:8
|
||||
implementation 'com.chartboost:chartboost-sdk:9.2.0' // Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:15
|
||||
implementation 'com.facebook.android:audience-network-sdk:6.12.0' // Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:8
|
||||
implementation 'com.facebook.android:facebook-applinks:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:6
|
||||
implementation 'com.facebook.android:facebook-core:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:5
|
||||
implementation 'com.facebook.android:facebook-gamingservices:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:9
|
||||
implementation 'com.facebook.android:facebook-login:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:7
|
||||
implementation 'com.facebook.android:facebook-share:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:8
|
||||
implementation 'com.fyber:marketplace-sdk:8.2.4' // Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
||||
implementation 'com.google.android.gms:play-services-ads:22.2.0' // Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:8
|
||||
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:17
|
||||
implementation 'com.google.android.gms:play-services-basement:18.1.0' // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:25
|
||||
implementation 'com.ironsource.adapters:adcolonyadapter:4.3.15' // Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:admobadapter:4.3.39' // Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:applovinadapter:4.3.39' // Assets/ThirdParty/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:chartboostadapter:4.3.12' // Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:facebookadapter:4.3.45' // Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:fyberadapter:4.3.28' // Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:mintegraladapter:4.3.19' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:48
|
||||
implementation 'com.ironsource.adapters:pangleadapter:4.3.22' // Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:tapjoyadapter:4.1.25' // Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:unityadsadapter:4.3.33' // Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:vungleadapter:4.3.22' // Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.sdk:mediationsdk:7.5.1' // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:9
|
||||
implementation 'com.mbridge.msdk.oversea:mbbanner:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:24
|
||||
implementation 'com.mbridge.msdk.oversea:mbbid:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:32
|
||||
implementation 'com.mbridge.msdk.oversea:newinterstitial:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:8
|
||||
implementation 'com.mbridge.msdk.oversea:reward:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:16
|
||||
implementation 'com.pangle.global:ads-sdk:5.5.0.5' // Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
||||
implementation 'com.fyber:marketplace-sdk:8.2.2' // Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
||||
implementation 'com.google.android.gms:play-services-ads:21.5.0' // Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:8
|
||||
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17
|
||||
implementation 'com.google.android.gms:play-services-basement:18.1.0' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25
|
||||
implementation 'com.ironsource.adapters:adcolonyadapter:4.3.14' // Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:admobadapter:4.3.35' // Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:applovinadapter:4.3.37' // Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:chartboostadapter:4.3.11' // Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:facebookadapter:4.3.39' // Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:fyberadapter:4.3.24' // Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:liftoffadapter:4.3.5' // Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:pangleadapter:4.3.17' // Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:tapjoyadapter:4.1.24' // Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:unityadsadapter:4.3.27' // Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.sdk:mediationsdk:7.3.0.1' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9
|
||||
implementation 'com.pangle.global:ads-sdk:5.0.0.8' // Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
||||
implementation 'com.parse.bolts:bolts-android:1.4.0' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:4
|
||||
implementation 'com.tapjoy:tapjoy-android-sdk:13.0.1' // Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
||||
implementation 'com.unity3d.ads:unity-ads:4.9.1' // Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
||||
implementation 'com.vungle:vungle-ads:7.0.0' // Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:8
|
||||
implementation 'com.tapjoy:tapjoy-android-sdk:12.11.1' // Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
||||
implementation 'com.unity3d.ads:unity-ads:4.6.1' // Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
||||
implementation 'io.liftoff:liftoffads:1.9.1' // Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:8
|
||||
// Android Resolver Dependencies End
|
||||
**DEPS**}
|
||||
|
||||
|
||||
@ -111,8 +111,8 @@ public partial class AdManager
|
||||
string networkPlacement = adInfo.NetworkPlacement; // The placement ID from the network that showed the ad
|
||||
string adFormat = adInfo.AdFormat;
|
||||
|
||||
var dict = new Dictionary<string, System.Object>();
|
||||
dict.Add("revenue", revenue);
|
||||
var dict = new Dictionary<string, string>();
|
||||
dict.Add("revenue", revenue.ToString());
|
||||
dict.Add("country_code", countryCode);
|
||||
dict.Add("network_name", networkName);
|
||||
dict.Add("ad_unit_Id", adUnitId);
|
||||
|
||||
@ -31,16 +31,15 @@ namespace BF
|
||||
|
||||
// SDK init
|
||||
BFLog.Log("unity-script: IronSource.Agent.init");
|
||||
// IronSource.Agent.setMetaData("is_test_suite", "enable");
|
||||
IronSource.Agent.init(appKey);
|
||||
IronSource.Agent.setManualLoadRewardedVideo(true);
|
||||
|
||||
// 初始化之前先设置一下用户id
|
||||
// ISAdQualityConfig adQualityConfig = new ISAdQualityConfig();
|
||||
// adQualityConfig.UserId = SystemInfo.deviceUniqueIdentifier;
|
||||
// // adQualityConfig.TestMode = true;
|
||||
// // adQualityConfig.LogLevel = ISAdQualityLogLevel.INFO;
|
||||
// IronSourceAdQuality.Initialize(appKey, adQualityConfig);
|
||||
ISAdQualityConfig adQualityConfig = new ISAdQualityConfig();
|
||||
adQualityConfig.UserId = SystemInfo.deviceUniqueIdentifier;
|
||||
// adQualityConfig.TestMode = true;
|
||||
// adQualityConfig.LogLevel = ISAdQualityLogLevel.INFO;
|
||||
IronSourceAdQuality.Initialize(appKey, adQualityConfig);
|
||||
#elif UNITY_IPHONE
|
||||
// string appKey = "8545d445";
|
||||
// 初始化之前先设置一下用户id
|
||||
@ -156,8 +155,6 @@ namespace BF
|
||||
void SdkInitializationCompletedEvent()
|
||||
{
|
||||
BFLog.Log("unity-script: I got SdkInitializationCompletedEvent");
|
||||
//Launch test suite
|
||||
// IronSource.Agent.launchTestSuite();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -286,8 +283,8 @@ namespace BF
|
||||
{
|
||||
return;
|
||||
}
|
||||
var dict = new Dictionary<string, System.Object>();
|
||||
dict.Add("revenue", revenue);
|
||||
var dict = new Dictionary<string, string>();
|
||||
dict.Add("revenue", revenue.ToString());
|
||||
dict.Add("auction_id", impressionData.auctionId);
|
||||
dict.Add("country_code", impressionData.country);
|
||||
dict.Add("network_name", impressionData.adNetwork);
|
||||
@ -301,7 +298,7 @@ namespace BF
|
||||
}
|
||||
if (!ReferenceEquals(impressionData.lifetimeRevenue, null))
|
||||
{
|
||||
dict.Add("lifetime_revenue", impressionData.lifetimeRevenue);
|
||||
dict.Add("lifetime_revenue", impressionData.lifetimeRevenue.ToString());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(impressionData.encryptedCPM))
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.20.1</unityversion>
|
||||
<unityversion>4.3.19.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.adcolony:sdk:4.8.0">
|
||||
<repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:adcolonyadapter:4.3.15">
|
||||
<androidPackage spec="com.ironsource.adapters:adcolonyadapter:4.3.14">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceAdColonyAdapter" version="4.3.17.1">
|
||||
<iosPod name="IronSourceAdColonyAdapter" version="4.3.16.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.54.0</unityversion>
|
||||
<unityversion>4.3.47.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.google.android.gms:play-services-ads:22.2.0">
|
||||
<androidPackage spec="com.google.android.gms:play-services-ads:21.5.0">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:admobadapter:4.3.39">
|
||||
<androidPackage spec="com.ironsource.adapters:admobadapter:4.3.35">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceAdMobAdapter" version="4.3.47.0">
|
||||
<iosPod name="IronSourceAdMobAdapter" version="4.3.41.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.44.3</unityversion>
|
||||
<unityversion>4.3.42.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:applovinadapter:4.3.39">
|
||||
<androidPackage spec="com.ironsource.adapters:applovinadapter:4.3.37">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.applovin:applovin-sdk:11.10.1">
|
||||
<androidPackage spec="com.applovin:applovin-sdk:11.7.1">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceAppLovinAdapter" version="4.3.40.3">
|
||||
<iosPod name="IronSourceAppLovinAdapter" version="4.3.38.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.19.2</unityversion>
|
||||
<unityversion>4.3.17.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:chartboostadapter:4.3.12">
|
||||
<androidPackage spec="com.ironsource.adapters:chartboostadapter:4.3.11">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.chartboost:chartboost-sdk:9.3.1">
|
||||
<androidPackage spec="com.chartboost:chartboost-sdk:9.2.0">
|
||||
<repositories>
|
||||
<repository>https://cboost.jfrog.io/artifactory/chartboost-ads/</repository>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceChartboostAdapter" version="4.3.15.2">
|
||||
<iosPod name="IronSourceChartboostAdapter" version="4.3.13.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.61.0</unityversion>
|
||||
<unityversion>4.3.52.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.facebook.android:audience-network-sdk:6.16.0">
|
||||
<androidPackage spec="com.facebook.android:audience-network-sdk:6.12.0">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:facebookadapter:4.3.45">
|
||||
<androidPackage spec="com.ironsource.adapters:facebookadapter:4.3.39">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceFacebookAdapter" version="4.3.43.0">
|
||||
<iosPod name="IronSourceFacebookAdapter" version="4.3.39.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.38.0</unityversion>
|
||||
<unityversion>4.3.34.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.fyber:marketplace-sdk:8.2.4">
|
||||
<androidPackage spec="com.fyber:marketplace-sdk:8.2.2">
|
||||
<repositories>
|
||||
<repository>https://repo.maven.apache.org/maven2/</repository>
|
||||
</repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:fyberadapter:4.3.28">
|
||||
<androidPackage spec="com.ironsource.adapters:fyberadapter:4.3.24">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceFyberAdapter" version="4.3.31.1">
|
||||
<iosPod name="IronSourceFyberAdapter" version="4.3.28.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.19.0</unityversion>
|
||||
<unityversion>4.3.16.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:newinterstitial:16.5.21">
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:newinterstitial:16.4.41">
|
||||
<repositories>
|
||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||
</repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:reward:16.5.21">
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:reward:16.4.41">
|
||||
<repositories>
|
||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:mbbanner:16.5.21">
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:mbbanner:16.4.41">
|
||||
<repositories>
|
||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||
</repositories>
|
||||
@ -25,7 +25,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:mbbid:16.5.21">
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:mbbid:16.4.41">
|
||||
<repositories>
|
||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||
</repositories>
|
||||
@ -41,7 +41,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:mintegraladapter:4.3.19">
|
||||
<androidPackage spec="com.ironsource.adapters:mintegraladapter:4.3.16">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -49,7 +49,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceMintegralAdapter" version="4.3.18.0">
|
||||
<iosPod name="IronSourceMintegralAdapter" version="4.3.15.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.27.0</unityversion>
|
||||
<unityversion>4.3.22.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:pangleadapter:4.3.22">
|
||||
<androidPackage spec="com.ironsource.adapters:pangleadapter:4.3.17">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.pangle.global:ads-sdk:5.5.0.5">
|
||||
<androidPackage spec="com.pangle.global:ads-sdk:5.0.0.8">
|
||||
<repositories>
|
||||
<repository>https://artifact.bytedance.com/repository/pangle/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourcePangleAdapter" version="4.3.24.0">
|
||||
<iosPod name="IronSourcePangleAdapter" version="4.3.19.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
<dependencies>
|
||||
<unityversion>4.1.30.3</unityversion>
|
||||
<unityversion>4.1.29.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:tapjoyadapter:4.1.25">
|
||||
<androidPackage spec="com.ironsource.adapters:tapjoyadapter:4.1.24">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.tapjoy:tapjoy-android-sdk:13.0.1">
|
||||
<androidPackage spec="com.tapjoy:tapjoy-android-sdk:12.11.1">
|
||||
<repositories>
|
||||
<repository>https://sdk.tapjoy.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceTapjoyAdapter" version="4.1.25.3">
|
||||
<iosPod name="IronSourceTapjoyAdapter" version="4.1.24.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.38.0</unityversion>
|
||||
<unityversion>4.3.32.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:unityadsadapter:4.3.33">
|
||||
<androidPackage spec="com.ironsource.adapters:unityadsadapter:4.3.27">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.unity3d.ads:unity-ads:4.9.1">
|
||||
<androidPackage spec="com.unity3d.ads:unity-ads:4.6.1">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
@ -16,7 +16,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceUnityAdsAdapter" version="4.3.33.0">
|
||||
<iosPod name="IronSourceUnityAdsAdapter" version="4.3.28.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.37.0</unityversion>
|
||||
<unityversion>4.3.33.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.vungle:vungle-ads:7.0.0">
|
||||
<androidPackage spec="com.vungle:publisher-sdk-android:6.12.1">
|
||||
<repositories>
|
||||
<repository>https://jitpack.io/</repository>
|
||||
</repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:vungleadapter:4.3.22">
|
||||
<androidPackage spec="com.ironsource.adapters:vungleadapter:4.3.20">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceVungleAdapter" version="4.3.29.0">
|
||||
<iosPod name="IronSourceVungleAdapter" version="4.3.26.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -220,7 +220,7 @@ public class IronSourceDependenciesManager : EditorWindow
|
||||
ProviderInfo info = new ProviderInfo();
|
||||
|
||||
object providerXML;
|
||||
var lowerCaseItem = item.Key.ToLower(new System.Globalization.CultureInfo("en"));
|
||||
var lowerCaseItem = item.Key.ToLower();
|
||||
|
||||
linksDictionary.TryGetValue(lowerCaseItem, out providerXML);
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ public class IronSourceManifestProcessor : IPreprocessBuild
|
||||
private const string AD_ID_PERMISSION_ATTR = "com.google.android.gms.permission.AD_ID";
|
||||
private const string MANIFEST_PERMISSION = "uses-permission";
|
||||
private const string MANIFEST_META_DATA = "meta-data";
|
||||
private const string IRONSOURCE_MANIFEST_PATH = "IronSource/Plugins/Android/IronSource.androidlib/AndroidManifest.xml";
|
||||
private const string IRONSOURCE_MANIFEST_PATH = "IronSource/Plugins/Android/IronSource.plugin/AndroidManifest.xml";
|
||||
private string manifestPath = "";
|
||||
private XNamespace ns = "http://schemas.android.com/apk/res/android";
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<dependencies>
|
||||
<unityversion>7.5.1</unityversion>
|
||||
<unityversion>7.3.0.1</unityversion>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.sdk:mediationsdk:7.5.1">
|
||||
<androidPackage spec="com.ironsource.sdk:mediationsdk:7.3.0.1">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -26,7 +26,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceSDK" version="7.5.0.0">
|
||||
<iosPod name="IronSourceSDK" version="7.3.0.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
BIN
Assets/ThirdParty/IronSource/Editor/IronSource_IntegrationManager.unitypackage
vendored
Normal file
BIN
Assets/ThirdParty/IronSource/Editor/IronSource_IntegrationManager.unitypackage
vendored
Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6d91e910c9af49d7a1d0254340e9dca
|
||||
guid: 43f2c8ee7c4303948bbd5f896c515318
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@ -1,28 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 718f851be2f4c4ee9b4c748b225a7ea2
|
||||
folderAsset: yes
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ironsource.unity">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<application>
|
||||
<!-- AdMob -->
|
||||
<!--As Requiered By Admob please add your App ID-->
|
||||
<!--<meta-data-->
|
||||
<!--android:name="com.google.android.gms.ads.APPLICATION_ID"-->
|
||||
<!--android:value="YOUR_ADMOB_APP_ID"/>-->
|
||||
</application>
|
||||
</manifest>
|
||||
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
target=android-9
|
||||
android.library=true
|
||||
22
Assets/ThirdParty/IronSource/Scripts/AdFormat.cs
vendored
22
Assets/ThirdParty/IronSource/Scripts/AdFormat.cs
vendored
@ -1,22 +0,0 @@
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the available formats for displaying advertisements.
|
||||
/// </summary>
|
||||
public enum AdFormat
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a rewarded video ad format.
|
||||
/// </summary>
|
||||
RewardedVideo,
|
||||
|
||||
/// <summary>
|
||||
/// Represents an interstitial ad format.
|
||||
/// </summary>
|
||||
Interstitial,
|
||||
|
||||
/// <summary>
|
||||
/// Represents a banner ad format.
|
||||
/// </summary>
|
||||
Banner
|
||||
}
|
||||
@ -2,20 +2,15 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System;
|
||||
|
||||
public class AndroidAgent : IronSourceIAgent
|
||||
{
|
||||
static AndroidJavaObject _androidBridge;
|
||||
readonly static string AndroidBridge = "com.ironsource.unity.androidbridge.AndroidBridge";
|
||||
const string REWARD_AMOUNT = "reward_amount";
|
||||
const string REWARD_NAME = "reward_name";
|
||||
const string PLACEMENT_NAME = "placement_name";
|
||||
|
||||
const string WATERFALL_CONFIG_FLOOR = "floor";
|
||||
const string WATERFALL_CONFIG_CEILING = "ceiling";
|
||||
const string WATERFALL_CONFIG_API = "setWaterfallConfiguration";
|
||||
private static AndroidJavaObject _androidBridge;
|
||||
private readonly static string AndroidBridge = "com.ironsource.unity.androidbridge.AndroidBridge";
|
||||
private const string REWARD_AMOUNT = "reward_amount";
|
||||
private const string REWARD_NAME = "reward_name";
|
||||
private const string PLACEMENT_NAME = "placement_name";
|
||||
|
||||
public AndroidAgent ()
|
||||
{
|
||||
@ -39,48 +34,6 @@ public class AndroidAgent : IronSourceIAgent
|
||||
|
||||
//******************* Base API *******************//
|
||||
|
||||
/// <summary>
|
||||
/// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||
/// </summary>
|
||||
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||
public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||
{
|
||||
var ceiling = waterfallConfiguration.Ceiling;
|
||||
var floor = waterfallConfiguration.Floor;
|
||||
var dict = new Dictionary<string, string>();
|
||||
|
||||
if (ceiling.HasValue)
|
||||
{
|
||||
dict.Add(WATERFALL_CONFIG_CEILING, ceiling.Value.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
if (floor.HasValue)
|
||||
{
|
||||
dict.Add(WATERFALL_CONFIG_FLOOR, floor.Value.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
var json = IronSourceJSON.Json.Serialize(dict);
|
||||
string stringAdFormat;
|
||||
|
||||
switch (adFormat)
|
||||
{
|
||||
case AdFormat.RewardedVideo:
|
||||
stringAdFormat = "REWARDED_VIDEO";
|
||||
break;
|
||||
case AdFormat.Interstitial:
|
||||
stringAdFormat = "INTERSTITIAL";
|
||||
break;
|
||||
case AdFormat.Banner:
|
||||
stringAdFormat = "BANNER";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
getBridge().Call(WATERFALL_CONFIG_API, json, stringAdFormat);
|
||||
}
|
||||
|
||||
public void onApplicationPause (bool pause)
|
||||
{
|
||||
if (pause)
|
||||
|
||||
@ -7,7 +7,7 @@ public class IronSource : IronSourceIAgent
|
||||
{
|
||||
private IronSourceIAgent _platformAgent;
|
||||
private static IronSource _instance;
|
||||
public static string UNITY_PLUGIN_VERSION = "7.5.1-r";
|
||||
public static string UNITY_PLUGIN_VERSION = "7.3.0.1-r";
|
||||
private static bool isUnsupportedPlatform;
|
||||
|
||||
private IronSource()
|
||||
@ -67,16 +67,6 @@ public class IronSource : IronSourceIAgent
|
||||
|
||||
//******************* Base API *******************//
|
||||
|
||||
/// <summary>
|
||||
/// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||
/// </summary>
|
||||
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||
public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||
{
|
||||
_platformAgent.SetWaterfallConfiguration(waterfallConfiguration, adFormat);
|
||||
}
|
||||
|
||||
public void onApplicationPause(bool pause)
|
||||
{
|
||||
_platformAgent.onApplicationPause(pause);
|
||||
@ -266,25 +256,21 @@ public class IronSource : IronSourceIAgent
|
||||
|
||||
//******************* Offerwall API *******************//
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public void showOfferwall()
|
||||
{
|
||||
_platformAgent.showOfferwall();
|
||||
}
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public void showOfferwall(string placementName)
|
||||
{
|
||||
_platformAgent.showOfferwall(placementName);
|
||||
}
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public void getOfferwallCredits()
|
||||
{
|
||||
_platformAgent.getOfferwallCredits();
|
||||
}
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public bool isOfferwallAvailable()
|
||||
{
|
||||
return _platformAgent.isOfferwallAvailable();
|
||||
|
||||
@ -83,17 +83,11 @@ public class IronSourceEvents : MonoBehaviour
|
||||
[Obsolete("This API has been deprecated as of SDK 7.3.0.1", false)]
|
||||
public static event Action<string, IronSourceError> onInterstitialAdShowFailedDemandOnlyEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<bool> onOfferwallAvailableEvent;
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action onOfferwallOpenedEvent;
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<Dictionary<string, object>> onOfferwallAdCreditedEvent;
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<IronSourceError> onGetOfferwallCreditsFailedEvent;
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action onOfferwallClosedEvent;
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<IronSourceError> onOfferwallShowFailedEvent;
|
||||
|
||||
[Obsolete("This API has been deprecated as of SDK 7.3.0. Please use the alternate API in IronSourceBannerEvents listener instead.", false)]
|
||||
@ -1649,7 +1643,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action _onOfferwallOpenedEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action onOfferwallOpenedEvent
|
||||
{
|
||||
add
|
||||
@ -1679,7 +1672,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action<IronSourceError> _onOfferwallShowFailedEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<IronSourceError> onOfferwallShowFailedEvent
|
||||
{
|
||||
add
|
||||
@ -1710,7 +1702,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action _onOfferwallClosedEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action onOfferwallClosedEvent
|
||||
{
|
||||
add
|
||||
@ -1740,7 +1731,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action<IronSourceError> _onGetOfferwallCreditsFailedEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<IronSourceError> onGetOfferwallCreditsFailedEvent
|
||||
{
|
||||
add
|
||||
@ -1772,7 +1762,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action<Dictionary<string, object>> _onOfferwallAdCreditedEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<Dictionary<string, object>> onOfferwallAdCreditedEvent
|
||||
{
|
||||
add
|
||||
@ -1800,7 +1789,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action<bool> _onOfferwallAvailableEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<bool> onOfferwallAvailableEvent
|
||||
{
|
||||
add
|
||||
|
||||
@ -4,13 +4,6 @@ public interface IronSourceIAgent
|
||||
{
|
||||
//******************* Base API *******************//
|
||||
|
||||
/// <summary>
|
||||
/// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||
/// </summary>
|
||||
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||
void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat);
|
||||
|
||||
void onApplicationPause(bool pause);
|
||||
|
||||
string getAdvertiserId();
|
||||
|
||||
@ -11,15 +11,6 @@ public class UnsupportedPlatformAgent : IronSourceIAgent
|
||||
|
||||
#region IronSourceAgent implementation
|
||||
|
||||
/// <summary>
|
||||
/// This function is not supported on the current platform and does nothing.
|
||||
/// </summary>
|
||||
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||
public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||
{
|
||||
}
|
||||
|
||||
public void start()
|
||||
{
|
||||
}
|
||||
|
||||
@ -1,92 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration class which allows users to customize or filter a Waterfall.
|
||||
/// </summary>
|
||||
public class WaterfallConfiguration
|
||||
{
|
||||
readonly double? ceiling;
|
||||
readonly double? floor;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ceiling value.
|
||||
/// </summary>
|
||||
public double? Ceiling { get { return ceiling; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the floor value.
|
||||
/// </summary>
|
||||
public double? Floor { get { return floor; } }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the WaterfallConfiguration class.
|
||||
/// </summary>
|
||||
/// <param name="ceiling">The ceiling value.</param>
|
||||
/// <param name="floor">The floor value.</param>
|
||||
private WaterfallConfiguration(double? ceiling, double? floor)
|
||||
{
|
||||
this.ceiling = ceiling;
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a builder for creating instances of WaterfallConfiguration.
|
||||
/// </summary>
|
||||
/// <returns>The WaterfallConfigurationBuilder.</returns>
|
||||
public static WaterfallConfigurationBuilder Builder()
|
||||
{
|
||||
return new WaterfallConfigurationBuilder();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an empty instance of WaterfallConfiguration.
|
||||
/// </summary>
|
||||
/// <returns>The empty WaterfallConfiguration.</returns>
|
||||
public static WaterfallConfiguration Empty()
|
||||
{
|
||||
return new WaterfallConfiguration(double.NaN, double.NaN);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builder class which to create a WaterfallConfiguration.
|
||||
/// </summary>
|
||||
public class WaterfallConfigurationBuilder
|
||||
{
|
||||
double? ceiling;
|
||||
double? floor;
|
||||
|
||||
internal WaterfallConfigurationBuilder() {}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the ceiling value.
|
||||
/// </summary>
|
||||
/// <param name="ceiling">The ceiling value.</param>
|
||||
/// <returns>The WaterfallConfigurationBuilder.</returns>
|
||||
public WaterfallConfigurationBuilder SetCeiling(double ceiling)
|
||||
{
|
||||
this.ceiling = ceiling;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the floor value.
|
||||
/// </summary>
|
||||
/// <param name="floor">The floor value.</param>
|
||||
/// <returns>The WaterfallConfigurationBuilder.</returns>
|
||||
public WaterfallConfigurationBuilder SetFloor(double floor)
|
||||
{
|
||||
this.floor = floor;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds an instance of WaterfallConfiguration based on the configured values.
|
||||
/// </summary>
|
||||
/// <returns>The created WaterfallConfiguration.</returns>
|
||||
public WaterfallConfiguration Build()
|
||||
{
|
||||
return new WaterfallConfiguration(ceiling, floor);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Assets/ThirdParty/IronSource/Scripts/iOSAgent.cs
vendored
29
Assets/ThirdParty/IronSource/Scripts/iOSAgent.cs
vendored
@ -1,23 +1,14 @@
|
||||
#if UNITY_IPHONE || UNITY_IOS
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
|
||||
// public class iOSAgent : IronSourceIAgent
|
||||
// {
|
||||
|
||||
// struct IOSWaterfallConfiguration
|
||||
// {
|
||||
// public double Floor;
|
||||
// public double Ceiling;
|
||||
// }
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void LPPSetWaterfallConfiguration(IOSWaterfallConfiguration configurationParams, AdFormat adFormat);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetPluginData(string pluginType, string pluginVersion, string pluginFrameworkVersion);
|
||||
|
||||
@ -200,22 +191,6 @@ using System.Globalization;
|
||||
|
||||
// //******************* Base API *******************//
|
||||
|
||||
// /// <summary>
|
||||
// /// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||
// /// </summary>
|
||||
// /// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||
// /// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||
// public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||
// {
|
||||
// var config = new IOSWaterfallConfiguration
|
||||
// {
|
||||
// Floor = waterfallConfiguration.Floor ?? 0.0,
|
||||
// Ceiling = waterfallConfiguration.Ceiling ?? 0.0
|
||||
// };
|
||||
|
||||
// LPPSetWaterfallConfiguration(config, adFormat);
|
||||
// }
|
||||
|
||||
// public void onApplicationPause(bool pause)
|
||||
// {
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c41a7273e266a0468c52d3a52652dbd
|
||||
guid: cd642f9c5d7126f47898e5dc9520a8ff
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 35853f28729a45d4cbb35043c5ff652f
|
||||
guid: 6ee27eb8be2558e4482bcaa12bbd4781
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
36
Assets/ThirdParty/IronSourceAdQuality/Editor/IronSourceAdQualityDependencies.xml
vendored
Normal file
36
Assets/ThirdParty/IronSourceAdQuality/Editor/IronSourceAdQualityDependencies.xml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
<dependencies>
|
||||
<unityversion>7.13.0</unityversion>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource:adqualitysdk:7.13.0">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.unity:adqualitysdk:7.13.0">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceAdQualitySDK" version="7.13.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
</iosPod>
|
||||
</iosPods>
|
||||
|
||||
<iosPods>
|
||||
<iosPod name="IronSourceAdQualityUnityBridge" version="7.13.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
</iosPod>
|
||||
</iosPods> -->
|
||||
|
||||
</dependencies>
|
||||
@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e46e3d39a8bec48d9ae81d0008842ad4
|
||||
DefaultImporter:
|
||||
guid: 0caf106b327a046c5b374834523d4477
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5936d92d17be4fde864e068dd13d202
|
||||
guid: c104a6ee5617fb048acdd3b2f1cbc512
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 78bb03eee4d26fb4da4755f7e6529784
|
||||
guid: ae460004d99634df8a86e07e1a01faa5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
6
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISADQualityDeviceIdType.cs
vendored
Normal file
6
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISADQualityDeviceIdType.cs
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
using System;
|
||||
public enum ISAdQualityDeviceIdType {
|
||||
NONE = 0,
|
||||
GAID = 1,
|
||||
IDFA = 2
|
||||
};
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8124546645b9349f7858c4510ea7de78
|
||||
guid: 92d1c3826af024ff1a77c6c7d7983c7d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
16
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityAdType.cs
vendored
Normal file
16
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityAdType.cs
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
public enum ISAdQualityAdType {
|
||||
UNKNOWN = -1,
|
||||
RICH_MEDIA = 0,
|
||||
INTERSTITIAL = 1,
|
||||
APP_WALL = 2,
|
||||
VIDEO = 3,
|
||||
REWARDED_VIDEO = 4,
|
||||
NATIVE = 5,
|
||||
BANNER = 6,
|
||||
OFFER_WALL = 7,
|
||||
NATIVE_HTML = 8,
|
||||
EXTERNAL = 9,
|
||||
REWARDED = 10,
|
||||
INTERACTIVE = 11
|
||||
};
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 354652886a99945cba942b569effe7bb
|
||||
guid: 08e1a7bef35354a1883fab85829a4273
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
53
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityAndroidInitHandler.cs
vendored
Normal file
53
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityAndroidInitHandler.cs
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
#if UNITY_ANDROID
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
[Preserve]
|
||||
public class ISAdQualityAndroidInitHandler : AndroidJavaProxy
|
||||
{
|
||||
private const string IRON_SOURCE_AD_QUALITY_CLASS = "com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality";
|
||||
private const string UNITY_IS_AD_QUALITY_INIT_LISTENER = "com.ironsource.adqualitysdk.sdk.unity.UnityISAdQualityInitListener";
|
||||
|
||||
public event Action OnAdQualitySdkInitSuccess = delegate { };
|
||||
public event Action<ISAdQualityInitError, string> OnAdQualitySdkInitFailed = delegate { };
|
||||
|
||||
//implements UnityISAdQualityInitListener java interface
|
||||
public ISAdQualityAndroidInitHandler(): base(UNITY_IS_AD_QUALITY_INIT_LISTENER)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
try
|
||||
{
|
||||
using (var jniAdQualityClass = new AndroidJavaClass(IRON_SOURCE_AD_QUALITY_CLASS))
|
||||
{
|
||||
jniAdQualityClass.CallStatic("setUnityISAdQualityInitListener", this);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
Debug.LogError("setUnityISAdQualityInitListener method doesn't exist, error: " + e.Message);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
[Preserve]
|
||||
public void adQualitySdkInitSuccess()
|
||||
{
|
||||
if (this.OnAdQualitySdkInitSuccess != null)
|
||||
{
|
||||
this.OnAdQualitySdkInitSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Preserve]
|
||||
public void adQualitySdkInitFailed(int adQualitySdkInitError, string errorMessage)
|
||||
{
|
||||
if (this.OnAdQualitySdkInitFailed != null)
|
||||
{
|
||||
this.OnAdQualitySdkInitFailed((ISAdQualityInitError)adQualitySdkInitError, errorMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea05efeb3467b0947b735c8fe281cb8c
|
||||
guid: c70eb41427c4848d391fa9e66f60daf3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
118
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityConfig.cs
vendored
Normal file
118
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityConfig.cs
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class ISAdQualityConfig
|
||||
{
|
||||
private String userId;
|
||||
private bool userIdSet;
|
||||
private bool testMode;
|
||||
private ISAdQualityInitCallback adQualityInitCallback;
|
||||
private ISAdQualityLogLevel logLevel;
|
||||
private String initializationSource;
|
||||
private bool coppa;
|
||||
private ISAdQualityDeviceIdType deviceIdType;
|
||||
|
||||
public ISAdQualityConfig()
|
||||
{
|
||||
userId = null;
|
||||
testMode = false;
|
||||
userIdSet = false;
|
||||
logLevel = ISAdQualityLogLevel.INFO;
|
||||
coppa = false;
|
||||
deviceIdType = ISAdQualityDeviceIdType.NONE;
|
||||
initializationSource = null;
|
||||
}
|
||||
|
||||
public String UserId
|
||||
{
|
||||
get
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
set
|
||||
{
|
||||
userIdSet = true;
|
||||
userId = value;
|
||||
}
|
||||
}
|
||||
|
||||
internal bool UserIdSet
|
||||
{
|
||||
get
|
||||
{
|
||||
return userIdSet;
|
||||
}
|
||||
}
|
||||
|
||||
public bool TestMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return testMode;
|
||||
}
|
||||
set
|
||||
{
|
||||
testMode = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ISAdQualityLogLevel LogLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
return logLevel;
|
||||
}
|
||||
set
|
||||
{
|
||||
logLevel = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ISAdQualityInitCallback AdQualityInitCallback
|
||||
{
|
||||
get
|
||||
{
|
||||
return adQualityInitCallback;
|
||||
}
|
||||
set
|
||||
{
|
||||
adQualityInitCallback = value;
|
||||
}
|
||||
}
|
||||
|
||||
public String InitializationSource
|
||||
{
|
||||
get
|
||||
{
|
||||
return initializationSource;
|
||||
}
|
||||
set
|
||||
{
|
||||
initializationSource = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Coppa
|
||||
{
|
||||
get
|
||||
{
|
||||
return coppa;
|
||||
}
|
||||
set
|
||||
{
|
||||
coppa = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ISAdQualityDeviceIdType DeviceIdType
|
||||
{
|
||||
get
|
||||
{
|
||||
return deviceIdType;
|
||||
}
|
||||
set
|
||||
{
|
||||
deviceIdType = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0acf281ba86b4929a6942ecd998395b
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Scripts/MaxEventSystemChecker.cs
|
||||
guid: 6ee3acefb6d46481191afc81fb1e4865
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
66
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityCustomMediationRevenue.cs
vendored
Normal file
66
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityCustomMediationRevenue.cs
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class ISAdQualityCustomMediationRevenue
|
||||
{
|
||||
private ISAdQualityMediationNetwork mediationNetwork;
|
||||
private ISAdQualityAdType adType;
|
||||
private double revenue;
|
||||
private String placement;
|
||||
|
||||
public ISAdQualityCustomMediationRevenue()
|
||||
{
|
||||
mediationNetwork = ISAdQualityMediationNetwork.UNKNOWN;
|
||||
adType = ISAdQualityAdType.UNKNOWN;
|
||||
revenue = 0;
|
||||
placement = null;
|
||||
}
|
||||
|
||||
public ISAdQualityMediationNetwork MediationNetwork
|
||||
{
|
||||
get
|
||||
{
|
||||
return mediationNetwork;
|
||||
}
|
||||
set
|
||||
{
|
||||
mediationNetwork = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ISAdQualityAdType AdType
|
||||
{
|
||||
get
|
||||
{
|
||||
return adType;
|
||||
}
|
||||
set
|
||||
{
|
||||
adType = value;
|
||||
}
|
||||
}
|
||||
|
||||
public double Revenue
|
||||
{
|
||||
get
|
||||
{
|
||||
return revenue;
|
||||
}
|
||||
set
|
||||
{
|
||||
revenue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public String Placement
|
||||
{
|
||||
get
|
||||
{
|
||||
return placement;
|
||||
}
|
||||
set
|
||||
{
|
||||
placement = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8bb7937cdf9c640cf8ee92ed1fa34227
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitCallback.cs
vendored
Normal file
8
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitCallback.cs
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public interface ISAdQualityInitCallback
|
||||
{
|
||||
void adQualitySdkInitSuccess();
|
||||
void adQualitySdkInitFailed(ISAdQualityInitError adQualityInitError, string errorMessage);
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitCallback.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitCallback.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 894fc956cbe6c43e385333baa4651e56
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
88
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitCallbackWrapper.cs
vendored
Normal file
88
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitCallbackWrapper.cs
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
public class ISAdQualityInitCallbackWrapper : MonoBehaviour
|
||||
{
|
||||
private ISAdQualityInitCallback mCallback;
|
||||
|
||||
#if UNITY_ANDROID
|
||||
private ISAdQualityAndroidInitHandler adQualityAndroidInitHandler;
|
||||
#endif
|
||||
|
||||
#if UNITY_IPHONE || UNITY_IOS
|
||||
// private ISAdQualityiOSInitHandler adQualityiOSInitHandler;
|
||||
#endif
|
||||
|
||||
public ISAdQualityInitCallback AdQualityInitCallback
|
||||
{
|
||||
set
|
||||
{
|
||||
mCallback = value;
|
||||
}
|
||||
get
|
||||
{
|
||||
return mCallback;
|
||||
}
|
||||
}
|
||||
|
||||
void Awake ()
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
adQualityAndroidInitHandler = new ISAdQualityAndroidInitHandler(); //sets this.adQualityAndroidInitHandler as listener for init events on the bridge
|
||||
registerAdQualityAndroidInitEvents();
|
||||
#endif
|
||||
|
||||
#if UNITY_IPHONE || UNITY_IOS
|
||||
// registerAdQualityiOSInitEvents();
|
||||
// adQualityiOSInitHandler = new ISAdQualityiOSInitHandler(); //sets this.adQualityiOSInit as listener for init events on the bridge
|
||||
#endif
|
||||
DontDestroyOnLoad(gameObject); //Makes the object not be destroyed automatically when loading a new scene.
|
||||
}
|
||||
|
||||
private void adQualitySdkInitSuccess()
|
||||
{
|
||||
if (mCallback != null)
|
||||
{
|
||||
mCallback.adQualitySdkInitSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
private void onAdQualitySdkInitFailed(ISAdQualityInitError sdkInitError, string errorMsg)
|
||||
{
|
||||
if (mCallback != null)
|
||||
{
|
||||
mCallback.adQualitySdkInitFailed(sdkInitError, errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_ANDROID
|
||||
//subscribe to ISAdQualityAndroidInitHandler events
|
||||
private void registerAdQualityAndroidInitEvents() {
|
||||
adQualityAndroidInitHandler.OnAdQualitySdkInitSuccess += () =>
|
||||
{
|
||||
adQualitySdkInitSuccess();
|
||||
};
|
||||
|
||||
adQualityAndroidInitHandler.OnAdQualitySdkInitFailed += (sdkInitError, errorMsg) =>
|
||||
{
|
||||
onAdQualitySdkInitFailed(sdkInitError, errorMsg);
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
#if UNITY_IPHONE || UNITY_IOS
|
||||
//subscribe to ISAdQualityiOSInitHandler events
|
||||
// private void registerAdQualityiOSInitEvents() {
|
||||
// ISAdQualityiOSInitHandler.OnAdQualitySdkInitSuccess += () =>
|
||||
// {
|
||||
// adQualitySdkInitSuccess();
|
||||
// };
|
||||
|
||||
// ISAdQualityiOSInitHandler.OnAdQualitySdkInitFailed += (sdkInitError, errorMsg) =>
|
||||
// {
|
||||
// onAdQualitySdkInitFailed(sdkInitError, errorMsg);
|
||||
// };
|
||||
// }
|
||||
#endif
|
||||
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitCallbackWrapper.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitCallbackWrapper.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1f5c838c5a8ff40529569d29728deec4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
14
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitError.cs
vendored
Normal file
14
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitError.cs
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
public enum ISAdQualityInitError {
|
||||
AD_QUALITY_SDK_WAS_SHUTDOWN = 0,
|
||||
ILLEGAL_USER_ID = 1,
|
||||
ILLEGAL_APP_KEY = 2,
|
||||
EXCEPTION_ON_INIT = 3,
|
||||
NO_NETWORK_CONNECTION = 4,
|
||||
CONFIG_LOAD_TIMEOUT = 5,
|
||||
CONNECTOR_LOAD_TIMEOUT = 6,
|
||||
AD_NETWORK_VERSION_NOT_SUPPORTED_YET = 7,
|
||||
AD_NETWORK_SDK_REQUIRES_NEWER_AD_QUALITY_SDK = 8,
|
||||
AD_QUALITY_ALREADY_INITIALIZED = 9
|
||||
};
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitError.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityInitError.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6da8d8e07e45042f197fc5f6304a9d62
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
495
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityJSON.cs
vendored
Normal file
495
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityJSON.cs
vendored
Normal file
@ -0,0 +1,495 @@
|
||||
/*
|
||||
* Based on the miniJSON by Calvin Rien
|
||||
*/
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace ISAdQualityJSON
|
||||
{
|
||||
public static class Json
|
||||
{
|
||||
public static object Deserialize (string json)
|
||||
{
|
||||
if (json == null) {
|
||||
return null;
|
||||
}
|
||||
return Parser.Parse (json);
|
||||
}
|
||||
|
||||
sealed class Parser : IDisposable
|
||||
{
|
||||
const string WHITE_SPACE = " \t\n\r";
|
||||
const string WORD_BREAK = " \t\n\r{}[],:\"";
|
||||
|
||||
enum TOKEN
|
||||
{
|
||||
NONE,
|
||||
CURLY_OPEN,
|
||||
CURLY_CLOSE,
|
||||
SQUARED_OPEN,
|
||||
SQUARED_CLOSE,
|
||||
COLON,
|
||||
COMMA,
|
||||
STRING,
|
||||
NUMBER,
|
||||
TRUE,
|
||||
FALSE,
|
||||
NULL
|
||||
}
|
||||
;
|
||||
|
||||
StringReader json;
|
||||
|
||||
Parser (string jsonString)
|
||||
{
|
||||
json = new StringReader (jsonString);
|
||||
}
|
||||
|
||||
public static object Parse (string jsonString)
|
||||
{
|
||||
using (var instance = new Parser(jsonString)) {
|
||||
return instance.ParseValue ();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose ()
|
||||
{
|
||||
json.Dispose ();
|
||||
json = null;
|
||||
}
|
||||
|
||||
Dictionary<string, object> ParseObject ()
|
||||
{
|
||||
Dictionary<string, object> table = new Dictionary<string, object> ();
|
||||
|
||||
// ditch opening brace
|
||||
json.Read ();
|
||||
|
||||
// {
|
||||
while (true) {
|
||||
switch (NextToken) {
|
||||
case TOKEN.NONE:
|
||||
return null;
|
||||
case TOKEN.COMMA:
|
||||
continue;
|
||||
case TOKEN.CURLY_CLOSE:
|
||||
return table;
|
||||
default:
|
||||
// name
|
||||
string name = ParseString ();
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// :
|
||||
if (NextToken != TOKEN.COLON) {
|
||||
return null;
|
||||
}
|
||||
// ditch the colon
|
||||
json.Read ();
|
||||
|
||||
// value
|
||||
table [name] = ParseValue ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<object> ParseArray ()
|
||||
{
|
||||
List<object> array = new List<object> ();
|
||||
|
||||
// ditch opening bracket
|
||||
json.Read ();
|
||||
|
||||
// [
|
||||
var parsing = true;
|
||||
while (parsing) {
|
||||
TOKEN nextToken = NextToken;
|
||||
|
||||
switch (nextToken) {
|
||||
case TOKEN.NONE:
|
||||
return null;
|
||||
case TOKEN.COMMA:
|
||||
continue;
|
||||
case TOKEN.SQUARED_CLOSE:
|
||||
parsing = false;
|
||||
break;
|
||||
default:
|
||||
object value = ParseByToken (nextToken);
|
||||
|
||||
array.Add (value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
object ParseValue ()
|
||||
{
|
||||
TOKEN nextToken = NextToken;
|
||||
return ParseByToken (nextToken);
|
||||
}
|
||||
|
||||
object ParseByToken (TOKEN token)
|
||||
{
|
||||
switch (token) {
|
||||
case TOKEN.STRING:
|
||||
return ParseString ();
|
||||
case TOKEN.NUMBER:
|
||||
return ParseNumber ();
|
||||
case TOKEN.CURLY_OPEN:
|
||||
return ParseObject ();
|
||||
case TOKEN.SQUARED_OPEN:
|
||||
return ParseArray ();
|
||||
case TOKEN.TRUE:
|
||||
return true;
|
||||
case TOKEN.FALSE:
|
||||
return false;
|
||||
case TOKEN.NULL:
|
||||
return null;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
string ParseString ()
|
||||
{
|
||||
StringBuilder s = new StringBuilder ();
|
||||
char c;
|
||||
|
||||
// ditch opening quote
|
||||
json.Read ();
|
||||
|
||||
bool parsing = true;
|
||||
while (parsing) {
|
||||
|
||||
if (json.Peek () == -1) {
|
||||
parsing = false;
|
||||
break;
|
||||
}
|
||||
|
||||
c = NextChar;
|
||||
switch (c) {
|
||||
case '"':
|
||||
parsing = false;
|
||||
break;
|
||||
case '\\':
|
||||
if (json.Peek () == -1) {
|
||||
parsing = false;
|
||||
break;
|
||||
}
|
||||
|
||||
c = NextChar;
|
||||
switch (c) {
|
||||
case '"':
|
||||
case '\\':
|
||||
case '/':
|
||||
s.Append (c);
|
||||
break;
|
||||
case 'b':
|
||||
s.Append ('\b');
|
||||
break;
|
||||
case 'f':
|
||||
s.Append ('\f');
|
||||
break;
|
||||
case 'n':
|
||||
s.Append ('\n');
|
||||
break;
|
||||
case 'r':
|
||||
s.Append ('\r');
|
||||
break;
|
||||
case 't':
|
||||
s.Append ('\t');
|
||||
break;
|
||||
case 'u':
|
||||
var hex = new StringBuilder ();
|
||||
|
||||
for (int i=0; i< 4; i++) {
|
||||
hex.Append (NextChar);
|
||||
}
|
||||
|
||||
s.Append ((char)Convert.ToInt32 (hex.ToString (), 16));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
s.Append (c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return s.ToString ();
|
||||
}
|
||||
|
||||
object ParseNumber ()
|
||||
{
|
||||
string number = NextWord;
|
||||
|
||||
if (number.IndexOf ('.') == -1) {
|
||||
long parsedInt;
|
||||
Int64.TryParse (number, NumberStyles.Any, CultureInfo.InvariantCulture, out parsedInt);
|
||||
return parsedInt;
|
||||
}
|
||||
|
||||
double parsedDouble;
|
||||
Double.TryParse (number, NumberStyles.Any, CultureInfo.InvariantCulture, out parsedDouble);
|
||||
return parsedDouble;
|
||||
}
|
||||
|
||||
void EatWhitespace ()
|
||||
{
|
||||
while (WHITE_SPACE.IndexOf(PeekChar) != -1) {
|
||||
json.Read ();
|
||||
|
||||
if (json.Peek () == -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char PeekChar {
|
||||
get {
|
||||
return Convert.ToChar (json.Peek ());
|
||||
}
|
||||
}
|
||||
|
||||
char NextChar {
|
||||
get {
|
||||
return Convert.ToChar (json.Read ());
|
||||
}
|
||||
}
|
||||
|
||||
string NextWord {
|
||||
get {
|
||||
StringBuilder word = new StringBuilder ();
|
||||
|
||||
while (WORD_BREAK.IndexOf(PeekChar) == -1) {
|
||||
word.Append (NextChar);
|
||||
|
||||
if (json.Peek () == -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return word.ToString ();
|
||||
}
|
||||
}
|
||||
|
||||
TOKEN NextToken {
|
||||
get {
|
||||
EatWhitespace ();
|
||||
|
||||
if (json.Peek () == -1) {
|
||||
return TOKEN.NONE;
|
||||
}
|
||||
|
||||
char c = PeekChar;
|
||||
switch (c) {
|
||||
case '{':
|
||||
return TOKEN.CURLY_OPEN;
|
||||
case '}':
|
||||
json.Read ();
|
||||
return TOKEN.CURLY_CLOSE;
|
||||
case '[':
|
||||
return TOKEN.SQUARED_OPEN;
|
||||
case ']':
|
||||
json.Read ();
|
||||
return TOKEN.SQUARED_CLOSE;
|
||||
case ',':
|
||||
json.Read ();
|
||||
return TOKEN.COMMA;
|
||||
case '"':
|
||||
return TOKEN.STRING;
|
||||
case ':':
|
||||
return TOKEN.COLON;
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
case '-':
|
||||
return TOKEN.NUMBER;
|
||||
}
|
||||
|
||||
string word = NextWord;
|
||||
|
||||
switch (word) {
|
||||
case "false":
|
||||
return TOKEN.FALSE;
|
||||
case "true":
|
||||
return TOKEN.TRUE;
|
||||
case "null":
|
||||
return TOKEN.NULL;
|
||||
}
|
||||
|
||||
return TOKEN.NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a IDictionary / IList object or a simple type (string, int, etc.) into a JSON string
|
||||
/// </summary>
|
||||
/// <param name="json">A Dictionary<string, object> / List<object></param>
|
||||
/// <returns>A JSON encoded string, or null if object 'json' is not serializable</returns>
|
||||
public static string Serialize (object obj)
|
||||
{
|
||||
return Serializer.Serialize (obj);
|
||||
}
|
||||
|
||||
sealed class Serializer
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
||||
Serializer ()
|
||||
{
|
||||
builder = new StringBuilder ();
|
||||
}
|
||||
|
||||
public static string Serialize (object obj)
|
||||
{
|
||||
var instance = new Serializer ();
|
||||
|
||||
instance.SerializeValue (obj);
|
||||
|
||||
return instance.builder.ToString ();
|
||||
}
|
||||
|
||||
void SerializeValue (object value)
|
||||
{
|
||||
IList asList;
|
||||
IDictionary asDict;
|
||||
string asStr;
|
||||
|
||||
if (value == null) {
|
||||
builder.Append ("null");
|
||||
} else if ((asStr = value as string) != null) {
|
||||
SerializeString (asStr);
|
||||
} else if (value is bool) {
|
||||
builder.Append (value.ToString ().ToLower ());
|
||||
} else if ((asList = value as IList) != null) {
|
||||
SerializeArray (asList);
|
||||
} else if ((asDict = value as IDictionary) != null) {
|
||||
SerializeObject (asDict);
|
||||
} else if (value is char) {
|
||||
SerializeString (value.ToString ());
|
||||
} else {
|
||||
SerializeOther (value);
|
||||
}
|
||||
}
|
||||
|
||||
void SerializeObject (IDictionary obj)
|
||||
{
|
||||
bool first = true;
|
||||
|
||||
builder.Append ('{');
|
||||
|
||||
foreach (object e in obj.Keys) {
|
||||
if (!first) {
|
||||
builder.Append (',');
|
||||
}
|
||||
|
||||
SerializeString (e.ToString ());
|
||||
builder.Append (':');
|
||||
|
||||
SerializeValue (obj [e]);
|
||||
|
||||
first = false;
|
||||
}
|
||||
|
||||
builder.Append ('}');
|
||||
}
|
||||
|
||||
void SerializeArray (IList anArray)
|
||||
{
|
||||
builder.Append ('[');
|
||||
|
||||
bool first = true;
|
||||
|
||||
foreach (object obj in anArray) {
|
||||
if (!first) {
|
||||
builder.Append (',');
|
||||
}
|
||||
|
||||
SerializeValue (obj);
|
||||
|
||||
first = false;
|
||||
}
|
||||
|
||||
builder.Append (']');
|
||||
}
|
||||
|
||||
void SerializeString (string str)
|
||||
{
|
||||
builder.Append ('\"');
|
||||
|
||||
char[] charArray = str.ToCharArray ();
|
||||
foreach (var c in charArray) {
|
||||
switch (c) {
|
||||
case '"':
|
||||
builder.Append ("\\\"");
|
||||
break;
|
||||
case '\\':
|
||||
builder.Append ("\\\\");
|
||||
break;
|
||||
case '\b':
|
||||
builder.Append ("\\b");
|
||||
break;
|
||||
case '\f':
|
||||
builder.Append ("\\f");
|
||||
break;
|
||||
case '\n':
|
||||
builder.Append ("\\n");
|
||||
break;
|
||||
case '\r':
|
||||
builder.Append ("\\r");
|
||||
break;
|
||||
case '\t':
|
||||
builder.Append ("\\t");
|
||||
break;
|
||||
default:
|
||||
int codepoint = Convert.ToInt32 (c);
|
||||
if ((codepoint >= 32) && (codepoint <= 126)) {
|
||||
builder.Append (c);
|
||||
} else {
|
||||
builder.Append ("\\u" + Convert.ToString (codepoint, 16).PadLeft (4, '0'));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
builder.Append ('\"');
|
||||
}
|
||||
|
||||
void SerializeOther (object value)
|
||||
{
|
||||
if (value is float
|
||||
|| value is int
|
||||
|| value is uint
|
||||
|| value is long
|
||||
|| value is double
|
||||
|| value is sbyte
|
||||
|| value is byte
|
||||
|| value is short
|
||||
|| value is ushort
|
||||
|| value is ulong
|
||||
|| value is decimal) {
|
||||
builder.Append (value.ToString ());
|
||||
} else {
|
||||
SerializeString (value.ToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityJSON.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityJSON.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a80f212ad97ca4136b919689ba6ad522
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
9
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityLogLevel.cs
vendored
Normal file
9
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityLogLevel.cs
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
using System;
|
||||
public enum ISAdQualityLogLevel {
|
||||
NONE = 0,
|
||||
ERROR = 1,
|
||||
WARNING = 2,
|
||||
INFO = 3,
|
||||
DEBUG = 4,
|
||||
VERBOSE = 5
|
||||
};
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityLogLevel.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityLogLevel.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c958a1a9721494cefb50a4fad4b6bb8b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
12
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityMediationNetwork.cs
vendored
Normal file
12
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityMediationNetwork.cs
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
public enum ISAdQualityMediationNetwork {
|
||||
UNKNOWN = -1,
|
||||
ADMOB = 0,
|
||||
DT_FAIR_BID = 1,
|
||||
HELIUM = 2,
|
||||
LEVEL_PLAY = 3,
|
||||
MAX = 4,
|
||||
UNITY = 5,
|
||||
SELF_MEDIATED = 6,
|
||||
OTHER = 7
|
||||
};
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityMediationNetwork.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityMediationNetwork.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b1c44dbefc86f46d7a84660f64b9ba47
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
66
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualitySegment.cs
vendored
Normal file
66
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualitySegment.cs
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Linq;
|
||||
|
||||
public class ISAdQualitySegment
|
||||
{
|
||||
public string name = null;
|
||||
public int age;
|
||||
public string gender = null;
|
||||
public int level;
|
||||
public int isPaying;
|
||||
public double inAppPurchasesTotal;
|
||||
public long userCreationDate;
|
||||
public Dictionary<string,string> customs;
|
||||
|
||||
public ISAdQualitySegment ()
|
||||
{
|
||||
age = -1;
|
||||
level = -1;
|
||||
isPaying = -1;
|
||||
inAppPurchasesTotal = -1;
|
||||
userCreationDate = -1;
|
||||
customs = new Dictionary<string,string> ();
|
||||
}
|
||||
|
||||
public void setCustom(string key, string value){
|
||||
customs.Add (key, value);
|
||||
}
|
||||
|
||||
public Dictionary<string,string> getSegmentAsDict ()
|
||||
{
|
||||
Dictionary<string,string> dict = new Dictionary<string,string> ();
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
{
|
||||
dict.Add ("name", name);
|
||||
}
|
||||
if (age != -1)
|
||||
{
|
||||
dict.Add ("age", age + "");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(gender))
|
||||
{
|
||||
dict.Add ("gender", gender);
|
||||
}
|
||||
if (level != -1)
|
||||
{
|
||||
dict.Add ("level", level + "");
|
||||
}
|
||||
if (isPaying > -1 && isPaying < 2)
|
||||
{
|
||||
dict.Add ("isPaying", isPaying + "");
|
||||
}
|
||||
if (inAppPurchasesTotal > -1)
|
||||
{
|
||||
dict.Add ("iapt", inAppPurchasesTotal + "");
|
||||
}
|
||||
if (userCreationDate != -1)
|
||||
{
|
||||
dict.Add ("userCreationDate", userCreationDate + "");
|
||||
}
|
||||
Dictionary<string,string> result = dict.Concat(customs).GroupBy(d => d.Key).ToDictionary(d => d.Key, d => d.First().Value);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualitySegment.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualitySegment.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bbf07b143b428454a85a0dccbb3bd7b0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
57
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityUtils.cs
vendored
Normal file
57
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityUtils.cs
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
public static class ISAdQualityUtils {
|
||||
|
||||
private static bool isDebugBuild = false;
|
||||
private static bool isDebugBuildSet = false;
|
||||
/// <summary>
|
||||
/// Creates Log Debug message according to given tag and message.
|
||||
/// </summary>
|
||||
/// <param name="tag">The name of the class whose instance called this function.</param>
|
||||
/// <param name="message">Debug message to output to log.</param>
|
||||
public static void LogDebug(string tag, string message)
|
||||
{
|
||||
if (!isDebugBuildSet)
|
||||
{
|
||||
try //Debug.isDebugBuild can fail on WP8 if it is not called from the Main Thread
|
||||
{
|
||||
isDebugBuild = Debug.isDebugBuild;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
isDebugBuild = true;
|
||||
Debug.Log(string.Format("{0} {1}", tag, e.Message));
|
||||
}
|
||||
isDebugBuildSet = true;
|
||||
}
|
||||
if (isDebugBuild)
|
||||
{
|
||||
Debug.Log(string.Format("{0} {1}", tag, message));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates Log Error message according to given tag and message.
|
||||
/// </summary>
|
||||
/// <param name="tag">The name of the class whose instance called this function..</param>
|
||||
/// <param name="message">Error message to output to log.</param>
|
||||
public static void LogError(string tag, string message) {
|
||||
Debug.LogError(string.Format("{0} {1}", tag, message));
|
||||
}
|
||||
|
||||
public static void LogWarning(string tag, string message) {
|
||||
Debug.LogWarning(string.Format("{0} {1}", tag, message));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the class name to be used in serialization/deserialization process
|
||||
/// </summary>
|
||||
/// <param name="target">The target to get class name for</param>
|
||||
/// <returns>The class name of the provided instance</returns>
|
||||
public static string GetClassName(object target) {
|
||||
return target.GetType().Name;
|
||||
}
|
||||
}
|
||||
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityUtils.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityUtils.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae84ef4134f7e4290bd18d994cd71a5b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
67
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityiOSInitHandler.cs
vendored
Normal file
67
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityiOSInitHandler.cs
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
// #if UNITY_IPHONE || UNITY_IOS
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Runtime.InteropServices;
|
||||
// using UnityEngine;
|
||||
|
||||
// public class ISAdQualityiOSInitHandler : MonoBehaviour
|
||||
// {
|
||||
// public static event Action OnAdQualitySdkInitSuccess = delegate { };
|
||||
// public static event Action<ISAdQualityInitError, string> OnAdQualitySdkInitFailed = delegate { };
|
||||
|
||||
|
||||
// #if UNITY_IOS && !UNITY_EDITOR
|
||||
// delegate void ISAdQualityUnityInitSuccessCallback(string args);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern int ironSourceAdQuality_registerInitSuccessCallback(ISAdQualityUnityInitSuccessCallback func);
|
||||
|
||||
// delegate void ISAdQualityUnityInitFailedCallback(string args);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void ironSourceAdQuality_registerInitFailedCallback(ISAdQualityUnityInitFailedCallback func);
|
||||
|
||||
// public ISAdQualityiOSInitHandler()
|
||||
// {
|
||||
// ironSourceAdQuality_registerInitSuccessCallback(fireInitSuccessCallback);
|
||||
// ironSourceAdQuality_registerInitFailedCallback(fireInitFailedCallback);
|
||||
// }
|
||||
|
||||
// [AOT.MonoPInvokeCallback(typeof(ISAdQualityUnityInitSuccessCallback))]
|
||||
// public static void fireInitSuccessCallback(string message)
|
||||
// {
|
||||
// if (OnAdQualitySdkInitSuccess != null)
|
||||
// {
|
||||
// OnAdQualitySdkInitSuccess();
|
||||
// }
|
||||
// }
|
||||
|
||||
// [AOT.MonoPInvokeCallback(typeof(ISAdQualityUnityInitFailedCallback))]
|
||||
// public static void fireInitFailedCallback(string message)
|
||||
// {
|
||||
// if (OnAdQualitySdkInitFailed != null)
|
||||
// {
|
||||
// ISAdQualityInitError sdkInitError = ISAdQualityInitError.EXCEPTION_ON_INIT;
|
||||
// string errorMsg = String.Empty;
|
||||
// try
|
||||
// {
|
||||
// if (!String.IsNullOrEmpty(message))
|
||||
// {
|
||||
// string[] separators = { "Unity:" };
|
||||
// string[] splitArray = message.Split(separators, System.StringSplitOptions.RemoveEmptyEntries);
|
||||
// if (splitArray.Length > 1)
|
||||
// {
|
||||
// sdkInitError = (ISAdQualityInitError)Enum.Parse(typeof(ISAdQualityInitError), splitArray[0]);
|
||||
// errorMsg = splitArray[1];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// errorMsg = e.Message;
|
||||
// }
|
||||
// OnAdQualitySdkInitFailed(sdkInitError, errorMsg);
|
||||
// }
|
||||
// }
|
||||
// #endif
|
||||
// }
|
||||
|
||||
// #endif
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityiOSInitHandler.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/ISAdQualityiOSInitHandler.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a21b72b3702244ccaa9227784e3fc6f3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
157
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/IronSourceAdQuality.cs
vendored
Normal file
157
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/IronSourceAdQuality.cs
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using ISAdQualityJSON;
|
||||
|
||||
public class IronSourceAdQuality : CodeGeneratedSingleton
|
||||
{
|
||||
private static GameObject adQualityGameObject = new GameObject("IronSourceAdQuality");
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
|
||||
// [DllImport ("__Internal")]
|
||||
// private static extern int ironSourceAdQuality_initialize(string appKey, string userId, bool userIdSet, bool testMode,
|
||||
// bool debug, int logLevel, string initializationSource, bool coppa,
|
||||
// int deviceIdType, bool isInitCallbackSet);
|
||||
// [DllImport ("__Internal")]
|
||||
// private static extern int ironSourceAdQuality_changeUserId(string userId);
|
||||
// [DllImport ("__Internal")]
|
||||
// private static extern int ironSourceAdQuality_setUserConsent(bool userConsent);
|
||||
// [DllImport ("__Internal")]
|
||||
// private static extern int ironSourceAdQuality_sendCustomMediationRevenue(int mediationNetwork, int adType, string placement, double revenue);
|
||||
// [DllImport ("__Internal")]
|
||||
// private static extern int ironSourceAdQuality_setSegment(string jsonString);
|
||||
|
||||
#endif
|
||||
|
||||
protected override bool DontDestroySingleton { get { return true; } }
|
||||
|
||||
protected override void InitAfterRegisteringAsSingleInstance() {
|
||||
base.InitAfterRegisteringAsSingleInstance();
|
||||
}
|
||||
|
||||
public static void Initialize(string appKey) {
|
||||
Initialize(appKey, new ISAdQualityConfig());
|
||||
}
|
||||
|
||||
public static void Initialize(string appKey, ISAdQualityConfig adQualityConfig) {
|
||||
if (adQualityConfig == null) {
|
||||
adQualityConfig = new ISAdQualityConfig();
|
||||
}
|
||||
Initialize(appKey,
|
||||
adQualityConfig.UserId,
|
||||
adQualityConfig.UserIdSet,
|
||||
adQualityConfig.TestMode,
|
||||
adQualityConfig.LogLevel,
|
||||
adQualityConfig.InitializationSource,
|
||||
adQualityConfig.Coppa,
|
||||
adQualityConfig.DeviceIdType,
|
||||
adQualityConfig.AdQualityInitCallback);
|
||||
}
|
||||
|
||||
private static void Initialize(string appKey,
|
||||
string userId,
|
||||
bool userIdSet,
|
||||
bool testMode,
|
||||
ISAdQualityLogLevel logLevel,
|
||||
string initializationSource,
|
||||
bool coppa,
|
||||
ISAdQualityDeviceIdType deviceIdType,
|
||||
ISAdQualityInitCallback adQualityInitCallback) {
|
||||
|
||||
#if !UNITY_EDITOR
|
||||
GetSynchronousCodeGeneratedInstance<IronSourceAdQuality>();
|
||||
ISAdQualityInitCallbackWrapper initCallbackWrapper = adQualityGameObject.GetComponent<ISAdQualityInitCallbackWrapper>();
|
||||
if (initCallbackWrapper == null) {
|
||||
initCallbackWrapper = adQualityGameObject.AddComponent<ISAdQualityInitCallbackWrapper>();
|
||||
}
|
||||
initCallbackWrapper.AdQualityInitCallback = adQualityInitCallback;
|
||||
bool isInitCallbackSet = (adQualityInitCallback != null);
|
||||
|
||||
#if UNITY_ANDROID
|
||||
AndroidJNI.PushLocalFrame(100);
|
||||
|
||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
||||
#endif
|
||||
|
||||
#if UNITY_ANDROID
|
||||
AndroidJNI.PushLocalFrame(100);
|
||||
using(AndroidJavaClass jniAdQualityClass = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality")) {
|
||||
AndroidJavaClass jLogLevelEnum = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.ISAdQualityLogLevel");
|
||||
AndroidJavaObject jLogLevel = jLogLevelEnum.CallStatic<AndroidJavaObject>("fromInt", (int)logLevel);
|
||||
AndroidJavaClass jDeviceIdTypeEnum = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.ISAdQualityDeviceIdType");
|
||||
AndroidJavaObject jDeviceIdType = jDeviceIdTypeEnum.CallStatic<AndroidJavaObject>("fromInt", (int)deviceIdType);
|
||||
jniAdQualityClass.CallStatic("initialize", appKey, userId, userIdSet, testMode, jLogLevel, initializationSource, coppa, jDeviceIdType, isInitCallbackSet);
|
||||
}
|
||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
||||
#elif UNITY_IOS
|
||||
// ironSourceAdQuality_initialize(appKey, userId, userIdSet ,testMode, DEBUG, (int)logLevel, initializationSource, coppa, (int)deviceIdType, isInitCallbackSet);
|
||||
#endif
|
||||
#else
|
||||
ISAdQualityUtils.LogWarning(TAG, "Ad Quality SDK works only on Android or iOS devices.");
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void ChangeUserId(String userId) {
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
AndroidJNI.PushLocalFrame(100);
|
||||
using(AndroidJavaClass jniAdQualityClass = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality")) {
|
||||
jniAdQualityClass.CallStatic("changeUserId", userId);
|
||||
}
|
||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
||||
#elif UNITY_IOS && !UNITY_EDITOR
|
||||
// ironSourceAdQuality_changeUserId(userId);
|
||||
#endif
|
||||
}
|
||||
|
||||
[Obsolete("This method has been deprecated and will be removed soon")]
|
||||
public static void SetUserConsent(bool userConsent) {
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
AndroidJNI.PushLocalFrame(100);
|
||||
using(AndroidJavaClass jniAdQualityClass = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality")) {
|
||||
jniAdQualityClass.CallStatic("setUserConsent", userConsent);
|
||||
}
|
||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
||||
#elif UNITY_IOS && !UNITY_EDITOR
|
||||
// ironSourceAdQuality_setUserConsent(userConsent);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void SendCustomMediationRevenue(ISAdQualityCustomMediationRevenue customMediationRevenue) {
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
AndroidJNI.PushLocalFrame(100);
|
||||
using(AndroidJavaClass jniAdQualityClass = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality")) {
|
||||
jniAdQualityClass.CallStatic("sendCustomMediationRevenue",
|
||||
(int) customMediationRevenue.MediationNetwork,
|
||||
(int) customMediationRevenue.AdType,
|
||||
customMediationRevenue.Placement,
|
||||
customMediationRevenue.Revenue);
|
||||
}
|
||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
||||
#elif UNITY_IOS && !UNITY_EDITOR
|
||||
// ironSourceAdQuality_sendCustomMediationRevenue((int) customMediationRevenue.MediationNetwork,
|
||||
// (int) customMediationRevenue.AdType,
|
||||
// customMediationRevenue.Placement,
|
||||
// customMediationRevenue.Revenue);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void setSegment(ISAdQualitySegment segment) {
|
||||
Dictionary <string,string> dict = segment.getSegmentAsDict();
|
||||
string jsonString = ISAdQualityJSON.Json.Serialize(dict);
|
||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||
AndroidJNI.PushLocalFrame(100);
|
||||
using(AndroidJavaClass jniAdQualityClass = new AndroidJavaClass("com.ironsource.adqualitysdk.sdk.unity.IronSourceAdQuality")) {
|
||||
jniAdQualityClass.CallStatic("setSegment", jsonString);
|
||||
}
|
||||
AndroidJNI.PopLocalFrame(IntPtr.Zero);
|
||||
#elif UNITY_IOS && !UNITY_EDITOR
|
||||
// ironSourceAdQuality_setSegment(jsonString);
|
||||
#endif
|
||||
}
|
||||
|
||||
private const string TAG = "IronSource AdQuality";
|
||||
private const bool DEBUG = false;
|
||||
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/IronSourceAdQuality.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/AdQuality/IronSourceAdQuality.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9316531db81604347bb41857c8e7ea43
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config.meta
vendored
Normal file
8
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config.meta
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4338140da312a4c6fb1614cd4725933a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
22
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/ISAdQualityEditorScript.cs
vendored
Normal file
22
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/ISAdQualityEditorScript.cs
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
using UnityEngine;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This class holds the store's configurations.
|
||||
/// </summary>
|
||||
public class ISAdQualityEditorScript : ScriptableObject
|
||||
{
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
static string currentModuleVersion = "7.13.0";
|
||||
|
||||
#endif
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/ISAdQualityEditorScript.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/ISAdQualityEditorScript.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e0d3ac0c6a1f4767826e6a49833d7c3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
208
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/IronSourceAdQualityManifestTools.cs
vendored
Normal file
208
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/IronSourceAdQualityManifestTools.cs
vendored
Normal file
@ -0,0 +1,208 @@
|
||||
using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class IronSourceAdQualityManifestTools
|
||||
{
|
||||
static string outputFile = Path.Combine(Application.dataPath, "Plugins/Android/AndroidManifest.xml");
|
||||
public static void GenerateManifest()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
// only copy over a fresh copy of the AndroidManifest if one does not exist
|
||||
if (!File.Exists(outputFile))
|
||||
{
|
||||
#if UNITY_4_5 || UNITY_4_6 || UNITY_5_0 || UNITY_5_1
|
||||
var inputFile = Path.Combine(EditorApplication.applicationContentsPath, "PlaybackEngines/androidplayer/AndroidManifest.xml");
|
||||
#elif UNITY_5_2
|
||||
var inputFile = Path.Combine(EditorApplication.applicationContentsPath, "PlaybackEngines/androidplayer/Apk/AndroidManifest.xml");
|
||||
#else
|
||||
var inputFile = Path.Combine(EditorApplication.applicationPath, "../PlaybackEngines/androidplayer/Apk/AndroidManifest.xml");
|
||||
#endif
|
||||
File.Copy(inputFile, outputFile);
|
||||
}
|
||||
UpdateManifest();
|
||||
#endif
|
||||
}
|
||||
|
||||
private static string _namespace = "";
|
||||
private static XmlDocument _document = null;
|
||||
private static XmlNode _manifestNode = null;
|
||||
private static XmlNode _applicationNode = null;
|
||||
|
||||
private static void LoadManifest(){
|
||||
_document = new XmlDocument();
|
||||
_document.Load(outputFile);
|
||||
|
||||
if (_document == null)
|
||||
{
|
||||
Debug.LogError("Couldn't load " + outputFile);
|
||||
return;
|
||||
}
|
||||
|
||||
_manifestNode = FindChildNode(_document, "manifest");
|
||||
_namespace = _manifestNode.GetNamespaceOfPrefix("android");
|
||||
_applicationNode = FindChildNode(_manifestNode, "application");
|
||||
|
||||
if (_applicationNode == null) {
|
||||
Debug.LogError("Error parsing " + outputFile);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private static void SaveManifest(){
|
||||
_document.Save(outputFile);
|
||||
}
|
||||
|
||||
public static void UpdateManifest() {
|
||||
LoadManifest ();
|
||||
|
||||
SetPermission("android.permission.INTERNET");
|
||||
SetPermission("android.permission.ACCESS_NETWORK_STATE");
|
||||
|
||||
SaveManifest ();
|
||||
}
|
||||
|
||||
public static void AddActivity(string activityName, Dictionary<string, string> attributes) {
|
||||
AppendApplicationElement("activity", activityName, attributes);
|
||||
}
|
||||
|
||||
public static void RemoveActivity(string activityName) {
|
||||
RemoveApplicationElement("activity", activityName);
|
||||
}
|
||||
|
||||
public static void SetPermission(string permissionName) {
|
||||
PrependManifestElement("uses-permission", permissionName);
|
||||
}
|
||||
|
||||
public static void RemovePermission(string permissionName) {
|
||||
RemoveManifestElement("uses-permission", permissionName);
|
||||
}
|
||||
|
||||
public static XmlElement AppendApplicationElement(string tagName, string name, Dictionary<string, string> attributes) {
|
||||
return AppendElementIfMissing(tagName, name, attributes, _applicationNode);
|
||||
}
|
||||
|
||||
public static void RemoveApplicationElement(string tagName, string name) {
|
||||
RemoveElement(tagName, name, _applicationNode);
|
||||
}
|
||||
|
||||
public static XmlElement PrependManifestElement(string tagName, string name) {
|
||||
return PrependElementIfMissing(tagName, name, null, _manifestNode);
|
||||
}
|
||||
|
||||
public static void RemoveManifestElement(string tagName, string name) {
|
||||
RemoveElement(tagName, name, _manifestNode);
|
||||
}
|
||||
|
||||
public static XmlElement AddMetaDataTag(string mdName, string mdValue) {
|
||||
return AppendApplicationElement("meta-data", mdName, new Dictionary<string, string>() {
|
||||
{ "value", mdValue }
|
||||
});
|
||||
}
|
||||
|
||||
public static XmlElement AppendElementIfMissing(string tagName, string name, Dictionary<string, string> otherAttributes, XmlNode parent) {
|
||||
XmlElement e = null;
|
||||
if (!string.IsNullOrEmpty(name)) {
|
||||
e = FindElementWithTagAndName(tagName, name, parent);
|
||||
}
|
||||
|
||||
if (e == null)
|
||||
{
|
||||
e = _document.CreateElement(tagName);
|
||||
if (!string.IsNullOrEmpty(name)) {
|
||||
e.SetAttribute("name", _namespace, name);
|
||||
}
|
||||
|
||||
parent.AppendChild(e);
|
||||
}
|
||||
|
||||
if (otherAttributes != null) {
|
||||
foreach(string key in otherAttributes.Keys) {
|
||||
e.SetAttribute(key, _namespace, otherAttributes[key]);
|
||||
}
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
public static XmlElement PrependElementIfMissing(string tagName, string name, Dictionary<string, string> otherAttributes, XmlNode parent) {
|
||||
XmlElement e = null;
|
||||
if (!string.IsNullOrEmpty(name)) {
|
||||
e = FindElementWithTagAndName(tagName, name, parent);
|
||||
}
|
||||
|
||||
if (e == null)
|
||||
{
|
||||
e = _document.CreateElement(tagName);
|
||||
if (!string.IsNullOrEmpty(name)) {
|
||||
e.SetAttribute("name", _namespace, name);
|
||||
}
|
||||
|
||||
parent.PrependChild(e);
|
||||
}
|
||||
|
||||
if (otherAttributes != null) {
|
||||
foreach(string key in otherAttributes.Keys) {
|
||||
e.SetAttribute(key, _namespace, otherAttributes[key]);
|
||||
}
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
public static void RemoveElement(string tagName, string name, XmlNode parent) {
|
||||
XmlElement e = FindElementWithTagAndName(tagName, name, parent);
|
||||
if (e != null)
|
||||
{
|
||||
parent.RemoveChild(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static XmlNode FindChildNode(XmlNode parent, string tagName)
|
||||
{
|
||||
XmlNode curr = parent.FirstChild;
|
||||
while (curr != null)
|
||||
{
|
||||
if (curr.Name.Equals(tagName))
|
||||
{
|
||||
return curr;
|
||||
}
|
||||
curr = curr.NextSibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static XmlElement FindChildElement(XmlNode parent, string tagName)
|
||||
{
|
||||
XmlNode curr = parent.FirstChild;
|
||||
while (curr != null)
|
||||
{
|
||||
if (curr.Name.Equals(tagName))
|
||||
{
|
||||
return curr as XmlElement;
|
||||
}
|
||||
curr = curr.NextSibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static XmlElement FindElementWithTagAndName(string tagName, string name, XmlNode parent)
|
||||
{
|
||||
var curr = parent.FirstChild;
|
||||
while (curr != null)
|
||||
{
|
||||
if (curr.Name.Equals(tagName) && curr is XmlElement && ((XmlElement)curr).GetAttribute("name", _namespace) == name)
|
||||
{
|
||||
return curr as XmlElement;
|
||||
}
|
||||
curr = curr.NextSibling;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/IronSourceAdQualityManifestTools.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/IronSourceAdQualityManifestTools.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62494cb2550224675873046db8776006
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
95
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/ObjectDictionary.cs
vendored
Normal file
95
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/ObjectDictionary.cs
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
// Copyright (c) 2012 Calvin Rien
|
||||
// http://the.darktable.com
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty. In
|
||||
// no event will the authors be held liable for any damages arising from the use
|
||||
// of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it freely,
|
||||
// subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not claim
|
||||
// that you wrote the original software. If you use this software in a product,
|
||||
// an acknowledgment in the product documentation would be appreciated but is not
|
||||
// required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
[System.Serializable]
|
||||
public sealed class ObjectKvp : UnityNameValuePair<string> {
|
||||
public string value = null;
|
||||
|
||||
override public string Value {
|
||||
get { return this.value; }
|
||||
set { this.value = value; }
|
||||
}
|
||||
|
||||
public ObjectKvp(string key, string value) : base(key, value) {
|
||||
}
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class ObjectDictionary : UnityDictionary<string> {
|
||||
public List<ObjectKvp> values;
|
||||
|
||||
override protected List<UnityKeyValuePair<string, string>> KeyValuePairs {
|
||||
get {
|
||||
if (values == null) {
|
||||
values = new List<ObjectKvp>();
|
||||
}
|
||||
|
||||
List<UnityKeyValuePair<string, string>> valuesConverted = new List<UnityKeyValuePair<string, string>>();
|
||||
foreach (ObjectKvp okvp in values)
|
||||
{
|
||||
valuesConverted.Add(ConvertOkvp(okvp));
|
||||
}
|
||||
|
||||
return valuesConverted;
|
||||
}
|
||||
set {
|
||||
if (value == null) {
|
||||
values = new List<ObjectKvp>();
|
||||
return;
|
||||
}
|
||||
|
||||
foreach(UnityKeyValuePair<string,string> ukvp in value)
|
||||
{
|
||||
values.Add(ConvertUkvp(ukvp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public new ObjectKvp ConvertUkvp(UnityKeyValuePair<string,string> ukvp)
|
||||
{
|
||||
return new ObjectKvp(ukvp.Key, ukvp.Value);
|
||||
|
||||
}
|
||||
public UnityKeyValuePair<string, string> ConvertOkvp(ObjectKvp okvp)
|
||||
{
|
||||
return new UnityKeyValuePair<string, string>(okvp.Key,okvp.Value);
|
||||
}
|
||||
override protected void SetKeyValuePair(string k, string v) {
|
||||
var index = values.FindIndex(x => {
|
||||
return x.Key == k;});
|
||||
|
||||
if (index != -1) {
|
||||
if (v == null) {
|
||||
values.RemoveAt(index);
|
||||
return;
|
||||
}
|
||||
|
||||
values[index] = new ObjectKvp(k, v);
|
||||
return;
|
||||
}
|
||||
|
||||
values.Add(new ObjectKvp(k, v));
|
||||
}
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/ObjectDictionary.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/ObjectDictionary.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d242fa04ee9a4fc79ae19ff5a74303d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
317
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/UnityDictionary.cs
vendored
Normal file
317
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/UnityDictionary.cs
vendored
Normal file
@ -0,0 +1,317 @@
|
||||
// Copyright (c) 2012 Calvin Rien
|
||||
// http://the.darktable.com
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied warranty. In
|
||||
// no event will the authors be held liable for any damages arising from the use
|
||||
// of this software.
|
||||
//
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it freely,
|
||||
// subject to the following restrictions:
|
||||
//
|
||||
// 1. The origin of this software must not be misrepresented; you must not claim
|
||||
// that you wrote the original software. If you use this software in a product,
|
||||
// an acknowledgment in the product documentation would be appreciated but is not
|
||||
// required.
|
||||
//
|
||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
//
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class UnityNameValuePair<V> : UnityKeyValuePair<string, V> {
|
||||
public string name = null;
|
||||
|
||||
override public string Key {
|
||||
get { return name; }
|
||||
set { name = value; }
|
||||
}
|
||||
|
||||
public UnityNameValuePair() : base() {
|
||||
}
|
||||
|
||||
public UnityNameValuePair(string key, V value) : base(key, value) {
|
||||
}
|
||||
}
|
||||
|
||||
public class UnityKeyValuePair<K, V> {
|
||||
virtual public K Key {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
virtual public V Value {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public UnityKeyValuePair() {
|
||||
Key = default(K);
|
||||
Value = default(V);
|
||||
}
|
||||
|
||||
public UnityKeyValuePair(K key, V value) {
|
||||
Key = key;
|
||||
Value = value;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class UnityDictionary<K,V> : IDictionary<K,V> {
|
||||
abstract protected List<UnityKeyValuePair<K,V>> KeyValuePairs {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
protected abstract void SetKeyValuePair(K k, V v); /* {
|
||||
var index = Collection.FindIndex(x => {return x.Key == k;});
|
||||
|
||||
if (index != -1) {
|
||||
if (v == null) {
|
||||
Collection.RemoveAt(index);
|
||||
return;
|
||||
}
|
||||
|
||||
values[index] = new UnityKeyValuePair(key, value);
|
||||
return;
|
||||
}
|
||||
|
||||
values.Add(new UnityKeyValuePair(key, value));
|
||||
} */
|
||||
|
||||
virtual public V this[K key] {
|
||||
get {
|
||||
var result = KeyValuePairs.Find(x => {
|
||||
return x.Key.Equals(key);});
|
||||
|
||||
if (result == null) {
|
||||
return default(V);
|
||||
}
|
||||
|
||||
return result.Value;
|
||||
}
|
||||
set {
|
||||
if (key == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
SetKeyValuePair(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
#region IDictionary interface
|
||||
|
||||
public void Add(K key, V value) {
|
||||
this[key] = value;
|
||||
}
|
||||
|
||||
public void Add(KeyValuePair<K, V> kvp) {
|
||||
this[kvp.Key] = kvp.Value;
|
||||
}
|
||||
|
||||
public bool TryGetValue(K key, out V value) {
|
||||
if (!this.ContainsKey(key)) {
|
||||
value = default(V);
|
||||
return false;
|
||||
}
|
||||
|
||||
value = this[key];
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Remove(KeyValuePair<K, V> item) {
|
||||
return Remove(item.Key);
|
||||
}
|
||||
|
||||
public bool Remove(K key) {
|
||||
var list = KeyValuePairs;
|
||||
|
||||
var index = list.FindIndex(x => {
|
||||
return x.Key.Equals(key);});
|
||||
|
||||
if (index == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
list.RemoveAt(index);
|
||||
|
||||
KeyValuePairs = list;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Clear() {
|
||||
var list = KeyValuePairs;
|
||||
|
||||
list.Clear();
|
||||
|
||||
KeyValuePairs = list;
|
||||
}
|
||||
|
||||
public bool ContainsKey(K key) {
|
||||
return KeyValuePairs.FindIndex(x => {
|
||||
return x.Key.Equals(key);}) != -1;
|
||||
}
|
||||
|
||||
public bool Contains(KeyValuePair<K, V> kvp) {
|
||||
return this[kvp.Key].Equals(kvp.Value);
|
||||
}
|
||||
|
||||
public int Count {
|
||||
get {
|
||||
return KeyValuePairs.Count;
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyTo(KeyValuePair<K, V>[] array, int index) {
|
||||
List<KeyValuePair<K, V>> copy = new List<KeyValuePair<K, V>>();
|
||||
for (int i = 0; i < KeyValuePairs.Count;i++)
|
||||
{
|
||||
copy[i] = ConvertUkvp(KeyValuePairs[i]);
|
||||
}
|
||||
copy.CopyTo(array, index);
|
||||
}
|
||||
|
||||
public KeyValuePair<K,V> ConvertUkvp(UnityKeyValuePair<K, V> ukvp)
|
||||
{
|
||||
return new KeyValuePair<K,V>(ukvp.Key,(V)ukvp.Value);
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() {
|
||||
return GetEnumerator() as IEnumerator;
|
||||
}
|
||||
|
||||
public IEnumerator<KeyValuePair<K, V>> GetEnumerator() {
|
||||
return new UnityDictionaryEnumerator(this);
|
||||
}
|
||||
|
||||
public ICollection<K> Keys {
|
||||
get {
|
||||
ICollection<K> keys = new List<K>();
|
||||
foreach(UnityKeyValuePair<K,V> ukvp in KeyValuePairs)
|
||||
{
|
||||
keys.Add(ukvp.Key);
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
}
|
||||
|
||||
public ICollection<V> Values {
|
||||
get {
|
||||
ICollection<V> values = new List<V>();
|
||||
foreach (UnityKeyValuePair<K, V> ukvp in KeyValuePairs)
|
||||
{
|
||||
values.Add(ukvp.Value);
|
||||
}
|
||||
return values;
|
||||
}
|
||||
}
|
||||
|
||||
public ICollection<KeyValuePair<K, V>> Items {
|
||||
get {
|
||||
List<KeyValuePair<K,V>> items = new List<KeyValuePair<K,V>>();
|
||||
foreach(UnityKeyValuePair<K,V> value in KeyValuePairs)
|
||||
{
|
||||
items.Add(new KeyValuePair<K, V>(value.Key, value.Value));
|
||||
}
|
||||
return items;
|
||||
}
|
||||
}
|
||||
|
||||
public V SyncRoot {
|
||||
get { return default(V); }
|
||||
}
|
||||
|
||||
public bool IsFixedSize {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public bool IsReadOnly {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public bool IsSynchronized {
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
internal sealed class UnityDictionaryEnumerator : IEnumerator<KeyValuePair<K, V>> {
|
||||
// A copy of the SimpleDictionary T's key/value pairs.
|
||||
KeyValuePair<K, V>[] items;
|
||||
int index = -1;
|
||||
|
||||
internal UnityDictionaryEnumerator() {
|
||||
}
|
||||
|
||||
internal UnityDictionaryEnumerator(UnityDictionary<K,V> ud) {
|
||||
// Make a copy of the dictionary entries currently in the SimpleDictionary T.
|
||||
items = new KeyValuePair<K, V>[ud.Count];
|
||||
|
||||
ud.CopyTo(items, 0);
|
||||
}
|
||||
|
||||
object IEnumerator.Current {
|
||||
get { return Current; }
|
||||
}
|
||||
|
||||
public KeyValuePair<K, V> Current {
|
||||
get {
|
||||
ValidateIndex();
|
||||
return items[index];
|
||||
}
|
||||
}
|
||||
|
||||
// Return the current dictionary entry.
|
||||
public KeyValuePair<K, V> Entry {
|
||||
get { return (KeyValuePair<K, V>) Current; }
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
index = -1;
|
||||
items = null;
|
||||
}
|
||||
|
||||
// Return the key of the current item.
|
||||
public K Key {
|
||||
get {
|
||||
ValidateIndex();
|
||||
return items[index].Key;
|
||||
}
|
||||
}
|
||||
|
||||
// Return the value of the current item.
|
||||
public V Value {
|
||||
get {
|
||||
ValidateIndex();
|
||||
return items[index].Value;
|
||||
}
|
||||
}
|
||||
|
||||
// Advance to the next item.
|
||||
public bool MoveNext() {
|
||||
if (index < items.Length - 1) {
|
||||
index++;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Validate the enumeration index and throw an exception if the index is out of range.
|
||||
private void ValidateIndex() {
|
||||
if (index < 0 || index >= items.Length) {
|
||||
throw new System.InvalidOperationException("Enumerator is before or after the collection.");
|
||||
}
|
||||
}
|
||||
|
||||
// Reset the index to restart the enumeration.
|
||||
public void Reset() {
|
||||
index = -1;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class UnityDictionary<V> : UnityDictionary<string, V> {
|
||||
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/UnityDictionary.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Config/UnityDictionary.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b3aeeb1755c04e6f80ffb1e982537f5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons.meta
vendored
Normal file
8
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons.meta
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 221bee1d14f6b4afaa10e6a0915411ba
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
16
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/BaseBehaviour.cs
vendored
Normal file
16
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/BaseBehaviour.cs
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class BaseBehaviour : MonoBehaviour
|
||||
{
|
||||
private Transform cashedTransform;
|
||||
public Transform CachedTransform
|
||||
{
|
||||
get { return cashedTransform ?? (cashedTransform = transform); }
|
||||
}
|
||||
|
||||
protected virtual void Awake() { }
|
||||
|
||||
protected virtual void Start() { }
|
||||
|
||||
protected virtual void OnDestroy() { }
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/BaseBehaviour.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/BaseBehaviour.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80937c3c4170b4ff59501e589794ddca
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
17
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/CodeGeneratedSingleton.cs
vendored
Normal file
17
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/CodeGeneratedSingleton.cs
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
#pragma warning disable 618
|
||||
/// <summary>
|
||||
/// A Singleton for use when your component needs to be accessed at any given (run)time and can be automagically created on demand.
|
||||
/// To use, override <see cref="UnitySingleton.InitAfterRegisteringAsSingleInstance"/> and write your initialization logic.
|
||||
/// If your singleton shouldn't be destroyed when moving between scenes (<see cref="UnityEngine.Object.DontDestroyOnLoad"/>),
|
||||
/// Override <see cref="UnitySingleton.DontDestroySingleton"/> and return true.
|
||||
/// Like this:
|
||||
///
|
||||
/// protected override bool DontDestroySingleton
|
||||
/// {
|
||||
/// get { return true; }
|
||||
/// }
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class CodeGeneratedSingleton : UnitySingleton
|
||||
{
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/CodeGeneratedSingleton.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/CodeGeneratedSingleton.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a0aa54a1a93447f6a59f4a1534ecbe7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
17
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/SceneSingleton.cs
vendored
Normal file
17
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/SceneSingleton.cs
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
#pragma warning disable 618
|
||||
/// <summary>
|
||||
/// A Singleton for use when your component needs to be blaced in a scene on design time.
|
||||
/// To use, override <see cref="UnitySingleton.InitAfterRegisteringAsSingleInstance"/> and write your initialization logic.
|
||||
/// If your singleton shouldn't be destroyed when moving between scenes (<see cref="UnityEngine.Object.DontDestroyOnLoad"/>),
|
||||
/// Override <see cref="UnitySingleton.DontDestroySingleton"/> and return true.
|
||||
/// Like this:
|
||||
///
|
||||
/// protected override bool DontDestroySingleton
|
||||
/// {
|
||||
/// get { return true; }
|
||||
/// }
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class SceneSingleton : UnitySingleton
|
||||
{
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/SceneSingleton.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/SceneSingleton.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b330e7d866904612b12283dfae41b84
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
271
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/UnitySingleton.cs
vendored
Normal file
271
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/UnitySingleton.cs
vendored
Normal file
@ -0,0 +1,271 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class UnitySingleton : BaseBehaviour
|
||||
{
|
||||
#region Private Variables
|
||||
private static readonly Dictionary<Type, UnitySingleton> instances = new Dictionary<Type, UnitySingleton>();
|
||||
private static readonly Dictionary<Type, Dictionary<MonoBehaviour, Action<UnitySingleton>>> instanceListeners =
|
||||
new Dictionary<Type, Dictionary<MonoBehaviour, Action<UnitySingleton>>>();
|
||||
#endregion
|
||||
|
||||
#region Private Properties
|
||||
protected bool IsInstanceReady { get; private set; }
|
||||
#endregion
|
||||
|
||||
#region Private Functions
|
||||
private void RegisterAsSingleInstanceAndInit()
|
||||
{
|
||||
instances.Add(GetType(), this);
|
||||
InnerInit();
|
||||
}
|
||||
|
||||
private void InnerInit()
|
||||
{
|
||||
InitAfterRegisteringAsSingleInstance();
|
||||
|
||||
if (DontDestroySingleton)
|
||||
{
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private static S GetOrCreateInstanceOnGameObject<S>(Type type) where S : CodeGeneratedSingleton
|
||||
{
|
||||
S instance = null;
|
||||
|
||||
var prefab = Resources.Load<GameObject>(type.Name);
|
||||
|
||||
if (prefab)
|
||||
{
|
||||
var instantiatedObject = Instantiate(prefab)
|
||||
#if !UNITY_5
|
||||
as GameObject
|
||||
#endif
|
||||
;
|
||||
|
||||
if (!instantiatedObject)
|
||||
{
|
||||
throw new Exception("Failed to instantiate prefab: " + type.Name);
|
||||
}
|
||||
|
||||
instance = instantiatedObject.GetComponent<S>();
|
||||
|
||||
if (!instance)
|
||||
{
|
||||
instance = instantiatedObject.AddComponent<S>();
|
||||
}
|
||||
}
|
||||
|
||||
if (!instance)
|
||||
{
|
||||
instance = new GameObject(type.Name).AddComponent<S>();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
private void NotifyInstanceListeners()
|
||||
{
|
||||
var type = GetType();
|
||||
|
||||
// Checks if there are any registered listeners for this type of singleton
|
||||
if (instanceListeners.ContainsKey(type))
|
||||
{
|
||||
foreach (var actionWithSender in instanceListeners[type].ToArray())
|
||||
{
|
||||
// If the sender is alive and has listeners - run its actions
|
||||
if (actionWithSender.Key && actionWithSender.Value != null)
|
||||
{
|
||||
actionWithSender.Value(this);
|
||||
}
|
||||
|
||||
// Either way - remove the sender + action from the collection
|
||||
instanceListeners[type].Remove(actionWithSender.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void DeclareAsReady()
|
||||
{
|
||||
IsInstanceReady = true;
|
||||
|
||||
NotifyInstanceListeners();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Public Functions
|
||||
protected static S GetSynchronousCodeGeneratedInstance<S>() where S : CodeGeneratedSingleton
|
||||
{
|
||||
var type = typeof(S);
|
||||
|
||||
S instance;
|
||||
|
||||
// An instance of this type does not exist
|
||||
if (!instances.ContainsKey(type))
|
||||
{
|
||||
// Try to find an existing one in the scene
|
||||
instance = FindObjectOfType<S>();
|
||||
|
||||
if (!instance)
|
||||
{
|
||||
// Creating a new one
|
||||
instance = GetOrCreateInstanceOnGameObject<S>(type);
|
||||
}
|
||||
|
||||
instance.RegisterAsSingleInstanceAndInit();
|
||||
}
|
||||
// An instance of this type already exists
|
||||
else
|
||||
{
|
||||
instance = instances[type] as S;
|
||||
}
|
||||
|
||||
if (!instance)
|
||||
{
|
||||
throw new Exception("No instance was created: " + type.Name);
|
||||
}
|
||||
|
||||
instance.IsInstanceReady = true;
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static void DoWithCodeGeneratedInstance<C>(MonoBehaviour sender, Action<C> whatToDoWithInstanceWhenItsReady) where C : CodeGeneratedSingleton
|
||||
{
|
||||
// Make sure an instance exists (creating it if it doesn't)
|
||||
GetSynchronousCodeGeneratedInstance<C>();
|
||||
|
||||
// Do the action with the existing instance or wait for it to be ready
|
||||
DoWithExistingInstance(sender, whatToDoWithInstanceWhenItsReady);
|
||||
}
|
||||
|
||||
public static void DoWithSceneInstance<S>(MonoBehaviour sender, Action<S> whatToDoWithInstanceWhenItsReady) where S : SceneSingleton
|
||||
{
|
||||
DoWithExistingInstance(sender, whatToDoWithInstanceWhenItsReady);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an action on an existing instance if and when it exists and ready
|
||||
/// </summary>
|
||||
/// <typeparam name="S"></typeparam>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="whatToDoWithInstanceWhenItsReady"></param>
|
||||
private static void DoWithExistingInstance<S>(MonoBehaviour sender, Action<S> whatToDoWithInstanceWhenItsReady) where S : UnitySingleton
|
||||
{
|
||||
var type = typeof(S);
|
||||
|
||||
var isInstanceNotExistOrReady = true;
|
||||
|
||||
// An instance of this type exists
|
||||
if (instances.ContainsKey(type))
|
||||
{
|
||||
var instance = instances[type] as S;
|
||||
|
||||
if (instance && instance.IsInstanceReady)
|
||||
{
|
||||
isInstanceNotExistOrReady = false;
|
||||
|
||||
// Call the action with the existing instance
|
||||
whatToDoWithInstanceWhenItsReady(instance);
|
||||
}
|
||||
}
|
||||
|
||||
// An instance of this type does not exist, we have to wait for it to initialize
|
||||
if (isInstanceNotExistOrReady)
|
||||
{
|
||||
if (!instanceListeners.ContainsKey(type))
|
||||
{
|
||||
instanceListeners.Add(type, new Dictionary<MonoBehaviour, Action<UnitySingleton>>());
|
||||
}
|
||||
|
||||
if (!instanceListeners[type].ContainsKey(sender))
|
||||
{
|
||||
instanceListeners[type].Add(sender, null);
|
||||
}
|
||||
|
||||
instanceListeners[type][sender] += singleton => whatToDoWithInstanceWhenItsReady(singleton as S);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Unity Functions
|
||||
protected sealed override void Start()
|
||||
{
|
||||
base.Start();
|
||||
|
||||
var type = GetType();
|
||||
|
||||
var needToDestroy = false;
|
||||
|
||||
// There's already an instance of my type
|
||||
if (instances.ContainsKey(type))
|
||||
{
|
||||
// The existing instance is not this instance so we've got a conflict (There can only be one!)
|
||||
if (instances[type] != this)
|
||||
{
|
||||
if (this is CodeGeneratedSingleton)
|
||||
{
|
||||
throw new Exception("There's already an instance for " + type.Name);
|
||||
}
|
||||
|
||||
if (this is SceneSingleton)
|
||||
{
|
||||
if (DontDestroySingleton)
|
||||
{
|
||||
// [this] is not the single instance (Singleton) so we actually DO need to destroy it
|
||||
needToDestroy = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// There's no instance of my type and I'm a CodeGeneratedSingleton
|
||||
// It should have been created via code so if I don't exist in the instance collection it means I was created on a scene
|
||||
else if (this is CodeGeneratedSingleton)
|
||||
{
|
||||
throw new NotSupportedException(string.Format("{0} is a {1} and needs to be created via code, and not placed on a scene!", type.Name, typeof(CodeGeneratedSingleton).Name));
|
||||
}
|
||||
|
||||
if (needToDestroy)
|
||||
{
|
||||
Debug.LogWarning(string.Format("There's already a {0} instance on the current scene, there's no point in staying.. goodbye.. I'm gonna go now :(", type.Name));
|
||||
|
||||
Destroy(this);
|
||||
}
|
||||
else if (this is SceneSingleton)
|
||||
{
|
||||
RegisterAsSingleInstanceAndInit();
|
||||
|
||||
SetReadyAndNotifyAfterRegistering();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override this if the singleton won't be ready immediately after registering as single instance
|
||||
/// </summary>
|
||||
protected virtual void SetReadyAndNotifyAfterRegistering()
|
||||
{
|
||||
DeclareAsReady();
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
var type = GetType();
|
||||
|
||||
// There's already an instance of my type but it's me - remove me
|
||||
if (instances.ContainsKey(type) && instances[type] == this)
|
||||
{
|
||||
instances.Remove(type);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Virtuals
|
||||
protected virtual void InitAfterRegisteringAsSingleInstance() { }
|
||||
protected virtual bool DontDestroySingleton { get { return false; } }
|
||||
#endregion
|
||||
}
|
||||
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/UnitySingleton.cs.meta
vendored
Normal file
11
Assets/ThirdParty/IronSourceAdQuality/Scripts/Singletons/UnitySingleton.cs.meta
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac12af7b0ebf6409c935fad7857982be
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.applovin:applovin-sdk:11.10.1" />
|
||||
<androidPackage spec="com.applovin:applovin-sdk:11.4.4" />
|
||||
</androidPackages>
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinSDK" version="11.10.1" />
|
||||
<iosPod name="AppLovinSDK" version="11.4.3" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -16,7 +16,6 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
||||
|
||||
- (void)createBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier atPosition:(NSString *)bannerPosition;
|
||||
- (void)createBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset;
|
||||
- (void)loadBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)setBannerBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode;
|
||||
- (void)setBannerPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)startBannerAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
@ -35,7 +34,6 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
||||
|
||||
- (void)createMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier atPosition:(NSString *)mrecPosition;
|
||||
- (void)createMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset;
|
||||
- (void)loadMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)setMRecPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)startMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)stopMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifer;
|
||||
@ -63,12 +61,6 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
||||
- (void)setInterstitialExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value;
|
||||
- (void)setInterstitialLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable id)value;
|
||||
|
||||
- (void)loadAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (BOOL)isAppOpenAdReadyWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)showAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData;
|
||||
- (void)setAppOpenAdExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value;
|
||||
- (void)setAppOpenAdLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable id)value;
|
||||
|
||||
- (void)loadRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (BOOL)isRewardedAdReadyWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)showRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData;
|
||||
@ -93,11 +85,8 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
||||
// User Service
|
||||
- (void)didDismissUserConsentDialog;
|
||||
|
||||
// Consent Flow
|
||||
- (void)startConsentFlow;
|
||||
|
||||
// Utils
|
||||
+ (NSString *)serializeParameters:(NSDictionary<NSString *, id> *)dict;
|
||||
+ (NSString *)serializeParameters:(NSDictionary<NSString *, NSString *> *)dict;
|
||||
|
||||
/**
|
||||
* Creates an instance of @c MAUnityAdManager if needed and returns the singleton instance.
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 4209563f82b8a4f7dabf03705ab761c6
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.h
|
||||
- al_max_export_path-MaxSdk\AppLovin\Plugins\iOS\MAUnityAdManager.h
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@ -15,7 +16,7 @@ PluginImporter:
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
'': Any
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
#import "MAUnityAdManager.h"
|
||||
|
||||
#define VERSION @"5.10.1"
|
||||
#define VERSION @"5.4.5"
|
||||
|
||||
#define KEY_WINDOW [UIApplication sharedApplication].keyWindow
|
||||
#define DEVICE_SPECIFIC_ADVIEW_AD_FORMAT ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) ? MAAdFormat.leader : MAAdFormat.banner
|
||||
@ -42,14 +42,13 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
@interface MAUnityAdManager()<MAAdDelegate, MAAdViewAdDelegate, MARewardedAdDelegate, MAAdRevenueDelegate, MAAdReviewDelegate, ALVariableServiceDelegate>
|
||||
@interface MAUnityAdManager()<MAAdDelegate, MAAdViewAdDelegate, MARewardedAdDelegate, MAAdRevenueDelegate, ALVariableServiceDelegate>
|
||||
|
||||
// Parent Fields
|
||||
@property (nonatomic, weak) ALSdk *sdk;
|
||||
|
||||
// Fullscreen Ad Fields
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MAInterstitialAd *> *interstitials;
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MAAppOpenAd *> *appOpenAds;
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MARewardedAd *> *rewardedAds;
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MARewardedInterstitialAd *> *rewardedInterstitialAds;
|
||||
|
||||
@ -68,7 +67,6 @@ extern "C" {
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSString *> *adViewCustomDataToSetAfterCreate;
|
||||
@property (nonatomic, strong) NSMutableArray<NSString *> *adUnitIdentifiersToShowAfterCreate;
|
||||
@property (nonatomic, strong) NSMutableSet<NSString *> *disabledAdaptiveBannerAdUnitIdentifiers;
|
||||
@property (nonatomic, strong) NSMutableSet<NSString *> *disabledAutoRefreshAdViewAdUnitIdentifiers;
|
||||
@property (nonatomic, strong) UIView *safeAreaBackground;
|
||||
@property (nonatomic, strong, nullable) UIColor *publisherBannerBackgroundColor;
|
||||
|
||||
@ -109,7 +107,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
if ( self )
|
||||
{
|
||||
self.interstitials = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
self.appOpenAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
self.rewardedAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
self.rewardedInterstitialAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
self.adViews = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
@ -126,7 +123,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
self.adViewCustomDataToSetAfterCreate = [NSMutableDictionary dictionaryWithCapacity: 1];
|
||||
self.adUnitIdentifiersToShowAfterCreate = [NSMutableArray arrayWithCapacity: 2];
|
||||
self.disabledAdaptiveBannerAdUnitIdentifiers = [NSMutableSet setWithCapacity: 2];
|
||||
self.disabledAutoRefreshAdViewAdUnitIdentifiers = [NSMutableSet setWithCapacity: 2];
|
||||
self.adInfoDict = [NSMutableDictionary dictionary];
|
||||
self.adInfoDictLock = [[NSObject alloc] init];
|
||||
|
||||
@ -176,15 +172,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
backgroundCallback = unityBackgroundCallback;
|
||||
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
|
||||
NSString *sdkKey = infoDict[@"AppLovinSdkKey"];
|
||||
if ( [sdkKey al_isValidString] )
|
||||
{
|
||||
self.sdk = [ALSdk sharedWithKey: sdkKey settings: [self generateSDKSettingsForAdUnitIdentifiers: serializedAdUnitIdentifiers metaData: serializedMetaData]];
|
||||
}
|
||||
else
|
||||
{
|
||||
self.sdk = [ALSdk sharedWithSettings:[self generateSDKSettingsForAdUnitIdentifiers:serializedAdUnitIdentifiers metaData:serializedMetaData]];
|
||||
}
|
||||
|
||||
self.sdk.variableService.delegate = self;
|
||||
[self.sdk setPluginVersion: [@"Max-Unity-" stringByAppendingString: VERSION]];
|
||||
self.sdk.mediationProvider = @"max";
|
||||
@ -199,8 +187,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
@"consentDialogState" : consentDialogStateStr,
|
||||
@"countryCode" : configuration.countryCode,
|
||||
@"appTrackingStatus" : appTrackingStatus,
|
||||
@"isSuccessfullyInitialized" : @([self.sdk isInitialized]),
|
||||
@"isTestModeEnabled" : @([configuration isTestModeEnabled])}];
|
||||
@"isSuccessfullyInitialized" : ([self.sdk isInitialized] ? @"true" : @"false")}];
|
||||
}];
|
||||
|
||||
return self.sdk;
|
||||
@ -218,11 +205,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier] atPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset)];
|
||||
}
|
||||
|
||||
- (void)loadBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
[self loadAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier]];
|
||||
}
|
||||
|
||||
- (void)setBannerBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode
|
||||
{
|
||||
[self setAdViewBackgroundColorForAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier] hexColorCode: hexColorCode];
|
||||
@ -310,11 +292,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset)];
|
||||
}
|
||||
|
||||
- (void)loadMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
[self loadAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||
}
|
||||
|
||||
- (void)setMRecPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
[self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||
@ -325,9 +302,9 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[self startAdViewAutoRefreshForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||
}
|
||||
|
||||
- (void)stopMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
- (void)stopMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifer
|
||||
{
|
||||
[self stopAdViewAutoRefreshForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||
[self stopAdViewAutoRefreshForAdUnitIdentifier: adUnitIdentifer adFormat: MAAdFormat.mrec];
|
||||
}
|
||||
|
||||
- (void)updateMRecPosition:(NSString *)mrecPosition forAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
@ -450,38 +427,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[interstitial setLocalExtraParameterForKey: key value: value];
|
||||
}
|
||||
|
||||
#pragma mark - App Open Ads
|
||||
|
||||
- (void)loadAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||
[appOpenAd loadAd];
|
||||
}
|
||||
|
||||
- (BOOL)isAppOpenAdReadyWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||
return [appOpenAd isReady];
|
||||
}
|
||||
|
||||
- (void)showAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData
|
||||
{
|
||||
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||
[appOpenAd showAdForPlacement: placement customData: customData];
|
||||
}
|
||||
|
||||
- (void)setAppOpenAdExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value
|
||||
{
|
||||
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||
[appOpenAd setExtraParameterForKey: key value: value];
|
||||
}
|
||||
|
||||
- (void)setAppOpenAdLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable id)value
|
||||
{
|
||||
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||
[appOpenAd setLocalExtraParameterForKey: key value: value];
|
||||
}
|
||||
|
||||
#pragma mark - Rewarded
|
||||
|
||||
- (void)loadRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
@ -623,7 +568,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
}
|
||||
|
||||
networkResponseDict[@"credentials"] = response.credentials;
|
||||
networkResponseDict[@"isBidding"] = @([response isBidding]);
|
||||
|
||||
MAError *error = response.error;
|
||||
if ( error )
|
||||
@ -692,10 +636,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialLoadedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdLoadedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdLoadedEvent";
|
||||
@ -748,10 +688,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialLoadFailedEvent";
|
||||
}
|
||||
else if ( self.appOpenAds[adUnitIdentifier] )
|
||||
{
|
||||
name = @"OnAppOpenAdLoadFailedEvent";
|
||||
}
|
||||
else if ( self.rewardedAds[adUnitIdentifier] )
|
||||
{
|
||||
name = @"OnRewardedAdLoadFailedEvent";
|
||||
@ -799,10 +735,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialClickedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdClickedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdClickedEvent";
|
||||
@ -836,10 +768,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialDisplayedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdDisplayedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdDisplayedEvent";
|
||||
@ -864,10 +792,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialAdFailedToDisplayEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdFailedToDisplayEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdFailedToDisplayEvent";
|
||||
@ -901,10 +825,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialHiddenEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdHiddenEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdHiddenEvent";
|
||||
@ -1032,10 +952,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialAdRevenuePaidEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdRevenuePaidEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdRevenuePaidEvent";
|
||||
@ -1054,41 +970,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[MAUnityAdManager forwardUnityEventWithArgs: args forwardInBackground: [adFormat isFullscreenAd]];
|
||||
}
|
||||
|
||||
- (void)didGenerateCreativeIdentifier:(NSString *)creativeIdentifier forAd:(MAAd *)ad
|
||||
{
|
||||
NSString *name;
|
||||
MAAdFormat *adFormat = ad.format;
|
||||
if ( MAAdFormat.banner == adFormat || MAAdFormat.leader == adFormat )
|
||||
{
|
||||
name = @"OnBannerAdReviewCreativeIdGeneratedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.mrec == adFormat )
|
||||
{
|
||||
name = @"OnMRecAdReviewCreativeIdGeneratedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.interstitial == adFormat )
|
||||
{
|
||||
name = @"OnInterstitialAdReviewCreativeIdGeneratedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdReviewCreativeIdGeneratedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewardedInterstitial == adFormat )
|
||||
{
|
||||
name = @"OnRewardedInterstitialAdReviewCreativeIdGeneratedEvent";
|
||||
}
|
||||
else
|
||||
{
|
||||
[self logInvalidAdFormat: adFormat];
|
||||
return;
|
||||
}
|
||||
|
||||
NSMutableDictionary<NSString *, id> *args = [self defaultAdEventParametersForName: name withAd: ad];
|
||||
args[@"adReviewCreativeId"] = creativeIdentifier;
|
||||
[MAUnityAdManager forwardUnityEventWithArgs: args];
|
||||
}
|
||||
|
||||
- (NSMutableDictionary<NSString *, id> *)defaultAdEventParametersForName:(NSString *)name withAd:(MAAd *)ad
|
||||
{
|
||||
NSMutableDictionary<NSString *, id> *args = [[self adInfoForAd: ad] mutableCopy];
|
||||
@ -1104,11 +985,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
max_unity_dispatch_on_main_thread(^{
|
||||
[self log: @"Creating %@ with ad unit identifier \"%@\" and position: \"%@\"", adFormat, adUnitIdentifier, adViewPosition];
|
||||
|
||||
if ( self.adViews[adUnitIdentifier] )
|
||||
{
|
||||
[self log: @"Trying to create a %@ that was already created. This will cause the current ad to be hidden.", adFormat.label];
|
||||
}
|
||||
|
||||
// Retrieve ad view from the map
|
||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: adViewPosition withOffset: offset];
|
||||
adView.hidden = YES;
|
||||
@ -1164,12 +1040,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
|
||||
[adView loadAd];
|
||||
|
||||
// Disable auto-refresh if publisher sets it before creating the ad view.
|
||||
if ( [self.disabledAutoRefreshAdViewAdUnitIdentifiers containsObject: adUnitIdentifier] )
|
||||
{
|
||||
[adView stopAutoRefresh];
|
||||
}
|
||||
|
||||
// The publisher may have requested to show the banner before it was created. Now that the banner is created, show it.
|
||||
if ( [self.adUnitIdentifiersToShowAfterCreate containsObject: adUnitIdentifier] )
|
||||
{
|
||||
@ -1179,32 +1049,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
});
|
||||
}
|
||||
|
||||
- (void)loadAdViewWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat
|
||||
{
|
||||
max_unity_dispatch_on_main_thread(^{
|
||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||
if ( !adView )
|
||||
{
|
||||
[self log: @"%@ does not exist for ad unit identifier %@.", adFormat.label, adUnitIdentifier];
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ![self.disabledAutoRefreshAdViewAdUnitIdentifiers containsObject: adUnitIdentifier] )
|
||||
{
|
||||
if ( [adView isHidden] )
|
||||
{
|
||||
[self log: @"Auto-refresh will resume when the %@ ad is shown. You should only call LoadBanner() or LoadMRec() if you explicitly pause auto-refresh and want to manually load an ad.", adFormat.label];
|
||||
return;
|
||||
}
|
||||
|
||||
[self log: @"You must stop auto-refresh if you want to manually load %@ ads.", adFormat.label];
|
||||
return;
|
||||
}
|
||||
|
||||
[adView loadAd];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)setAdViewBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat hexColorCode:(NSString *)hexColorCode
|
||||
{
|
||||
max_unity_dispatch_on_main_thread(^{
|
||||
@ -1238,8 +1082,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
max_unity_dispatch_on_main_thread(^{
|
||||
[self log: @"Starting %@ auto refresh for ad unit identifier \"%@\"", adFormat.label, adUnitIdentifier];
|
||||
|
||||
[self.disabledAutoRefreshAdViewAdUnitIdentifiers removeObject: adUnitIdentifier];
|
||||
|
||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||
if ( !adView )
|
||||
{
|
||||
@ -1256,8 +1098,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
max_unity_dispatch_on_main_thread(^{
|
||||
[self log: @"Stopping %@ auto refresh for ad unit identifier \"%@\"", adFormat.label, adUnitIdentifier];
|
||||
|
||||
[self.disabledAutoRefreshAdViewAdUnitIdentifiers addObject: adUnitIdentifier];
|
||||
|
||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||
if ( !adView )
|
||||
{
|
||||
@ -1432,10 +1272,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
self.safeAreaBackground.hidden = NO;
|
||||
view.hidden = NO;
|
||||
|
||||
if ( ![self.disabledAutoRefreshAdViewAdUnitIdentifiers containsObject: adUnitIdentifier] )
|
||||
{
|
||||
[view startAutoRefresh];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -1480,7 +1317,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
MAAdView *view = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||
view.delegate = nil;
|
||||
view.revenueDelegate = nil;
|
||||
view.adReviewDelegate = nil;
|
||||
|
||||
[view removeFromSuperview];
|
||||
|
||||
@ -1519,7 +1355,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
result = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||
result.delegate = self;
|
||||
result.revenueDelegate = self;
|
||||
result.adReviewDelegate = self;
|
||||
|
||||
self.interstitials[adUnitIdentifier] = result;
|
||||
}
|
||||
@ -1527,21 +1362,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
return result;
|
||||
}
|
||||
|
||||
- (MAAppOpenAd *)retrieveAppOpenAdForAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
MAAppOpenAd *result = self.appOpenAds[adUnitIdentifier];
|
||||
if ( !result )
|
||||
{
|
||||
result = [[MAAppOpenAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||
result.delegate = self;
|
||||
result.revenueDelegate = self;
|
||||
|
||||
self.appOpenAds[adUnitIdentifier] = result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (MARewardedAd *)retrieveRewardedAdForAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
MARewardedAd *result = self.rewardedAds[adUnitIdentifier];
|
||||
@ -1550,7 +1370,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
result = [MARewardedAd sharedWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||
result.delegate = self;
|
||||
result.revenueDelegate = self;
|
||||
result.adReviewDelegate = self;
|
||||
|
||||
self.rewardedAds[adUnitIdentifier] = result;
|
||||
}
|
||||
@ -1566,7 +1385,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
result = [[MARewardedInterstitialAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||
result.delegate = self;
|
||||
result.revenueDelegate = self;
|
||||
result.adReviewDelegate = self;
|
||||
|
||||
self.rewardedInterstitialAds[adUnitIdentifier] = result;
|
||||
}
|
||||
@ -1590,7 +1408,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
result.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
result.delegate = self;
|
||||
result.revenueDelegate = self;
|
||||
result.adReviewDelegate = self;
|
||||
|
||||
self.adViews[adUnitIdentifier] = result;
|
||||
self.adViewPositions[adUnitIdentifier] = adViewPosition;
|
||||
@ -1598,9 +1415,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
|
||||
UIViewController *rootViewController = [self unityViewController];
|
||||
[rootViewController.view addSubview: result];
|
||||
|
||||
// Allow pubs to pause auto-refresh immediately, by default.
|
||||
[result setExtraParameterForKey: @"allow_pause_auto_refresh_immediately" value: @"true"];
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -2015,25 +1829,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[MAUnityAdManager forwardUnityEventWithArgs: @{@"name" : @"OnSdkConsentDialogDismissedEvent"}];
|
||||
}
|
||||
|
||||
#pragma mark - Consent Flow
|
||||
|
||||
- (void)startConsentFlow
|
||||
{
|
||||
[self.sdk.cfService scfWithCompletionHander:^(ALCFError * _Nullable error) {
|
||||
|
||||
NSMutableDictionary<NSString *, id> *args = [NSMutableDictionary dictionaryWithCapacity: 3];
|
||||
args[@"name"] = @"OnSdkConsentFlowCompletedEvent";
|
||||
|
||||
if ( error )
|
||||
{
|
||||
args[@"code"] = @(error.code);
|
||||
args[@"message"] = error.message;
|
||||
}
|
||||
|
||||
[MAUnityAdManager forwardUnityEventWithArgs: args];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Variable Service (Deprecated)
|
||||
|
||||
- (void)loadVariables
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user