update: 更新Pubmatic的导入格式。

feature/item_system
胡宇飞 2024-01-15 20:52:22 +08:00
parent 84ecdd1dfc
commit b93770ad29
3 changed files with 26 additions and 13 deletions

View File

@ -14,7 +14,7 @@ namespace Guru.Editor
private const string GURU_SETTINGS_PATH = "Assets/Guru/Resources/GuruSettings.asset"; private const string GURU_SETTINGS_PATH = "Assets/Guru/Resources/GuruSettings.asset";
private const string APPLOVIN_SETTINGS_PATH = "Assets/Guru/Resources/AppLovinSettings.asset"; private const string APPLOVIN_SETTINGS_PATH = "Assets/Guru/Resources/AppLovinSettings.asset";
private const string FACEBOOK_SETTINGS_PATH = "Assets/FacebookSDK/SDK/Resources/FacebookSettings.asset"; private const string FACEBOOK_SETTINGS_PATH = "Assets/FacebookSDK/SDK/Resources/FacebookSettings.asset";
private const string ANDROID_KEYSTORE_PATH = "Packages/com.guru.unity.sdk.core/Keystore/guru.jks"; private const string ANDROID_KEYSTORE_PATH = "Assets/Plugins/Android/guru_key.jks";
private const string KeyMaxAutoUpdateEnabled = "com.applovin.auto_update_enabled"; private const string KeyMaxAutoUpdateEnabled = "com.applovin.auto_update_enabled";
@ -584,29 +584,29 @@ namespace Guru.Editor
p.boolValue = true; p.boolValue = true;
arr = _servicesConfig.ad_settings.pubmatic_ids_android; arr = _servicesConfig.ad_settings.pubmatic_ids_android;
if (IsArrayHasLength(arr, 4)) if (IsArrayHasLength(arr, 3))
{ {
p = n.serializedObject.FindProperty("PubmaticSetting.Android.storeUrl"); p = n.serializedObject.FindProperty("PubmaticSetting.Android.storeUrl");
p.stringValue = arr[0]; p.stringValue = _servicesConfig.app_settings.android_store;
p = n.serializedObject.FindProperty("PubmaticSetting.Android.bannerUnitID"); p = n.serializedObject.FindProperty("PubmaticSetting.Android.bannerUnitID");
p.stringValue = arr[1]; p.stringValue = arr[0];
p = n.serializedObject.FindProperty("PubmaticSetting.Android.interUnitID"); p = n.serializedObject.FindProperty("PubmaticSetting.Android.interUnitID");
p.stringValue = arr[2]; p.stringValue = arr[1];
p = n.serializedObject.FindProperty("PubmaticSetting.Android.rewardUnitID"); p = n.serializedObject.FindProperty("PubmaticSetting.Android.rewardUnitID");
p.stringValue = arr[3]; p.stringValue = arr[2];
} }
arr = _servicesConfig.ad_settings.pubmatic_ids_ios; arr = _servicesConfig.ad_settings.pubmatic_ids_ios;
if (IsArrayHasLength(arr, 4)) if (IsArrayHasLength(arr, 3))
{ {
p = n.serializedObject.FindProperty("PubmaticSetting.iOS.storeUrl"); p = n.serializedObject.FindProperty("PubmaticSetting.iOS.storeUrl");
p.stringValue = arr[0]; p.stringValue = _servicesConfig.app_settings.ios_store;
p = n.serializedObject.FindProperty("PubmaticSetting.iOS.bannerUnitID"); p = n.serializedObject.FindProperty("PubmaticSetting.iOS.bannerUnitID");
p.stringValue = arr[1]; p.stringValue = arr[0];
p = n.serializedObject.FindProperty("PubmaticSetting.iOS.interUnitID"); p = n.serializedObject.FindProperty("PubmaticSetting.iOS.interUnitID");
p.stringValue = arr[2]; p.stringValue = arr[1];
p = n.serializedObject.FindProperty("PubmaticSetting.iOS.rewardUnitID"); p = n.serializedObject.FindProperty("PubmaticSetting.iOS.rewardUnitID");
p.stringValue = arr[3]; p.stringValue = arr[2];
} }
} }
@ -814,12 +814,25 @@ namespace Guru.Editor
n = so.FindProperty("androidKeystorePath"); n = so.FindProperty("androidKeystorePath");
n.stringValue = ANDROID_KEYSTORE_PATH; n.stringValue = ANDROID_KEYSTORE_PATH;
DeployKeystore();
so.ApplyModifiedProperties(); so.ApplyModifiedProperties();
EditorUtility.SetDirty(settings); EditorUtility.SetDirty(settings);
AssetDatabase.SaveAssetIfDirty(settings); AssetDatabase.SaveAssetIfDirty(settings);
} }
private void DeployKeystore()
{
var from = "Packages/com.guru.unity.sdk.core/Editor/BuildTool/guru_key.jks";
var to = ANDROID_KEYSTORE_PATH.Replace("Assets", Application.dataPath);
if (File.Exists(from) && !File.Exists(to))
{
File.Copy(from, to);
}
}
private void ApplyMods() private void ApplyMods()
{ {
PlayerSettings.applicationIdentifier = _servicesConfig.app_settings.bundle_id; // 设置包名 PlayerSettings.applicationIdentifier = _servicesConfig.app_settings.bundle_id; // 设置包名

View File

@ -276,7 +276,7 @@ namespace Guru
{ {
string url = ""; string url = "";
#if UNITY_EDITOR #if UNITY_EDITOR
url = "test@com.guru.ai"; url = "https://test@com.guru.ai";
#elif UNITY_ANDROID #elif UNITY_ANDROID
url = GuruSettings?.AndroidStoreUrl ?? ""; url = GuruSettings?.AndroidStoreUrl ?? "";
#elif UNITY_IOS #elif UNITY_IOS

View File

@ -1,7 +1,7 @@
{ {
"name": "com.guru.unity.sdk", "name": "com.guru.unity.sdk",
"displayName": "Guru SDK", "displayName": "Guru SDK",
"version": "1.0.0", "version": "1.0.3",
"description": "Guru SDK for unity project", "description": "Guru SDK for unity project",
"unity": "2020.3", "unity": "2020.3",
"author":{ "author":{