update: 更新iOS配置
							parent
							
								
									7d3907665f
								
							
						
					
					
						commit
						ec534cbd3d
					
				|  | @ -11,9 +11,9 @@ public class AdjustSettings : ScriptableObject | |||
|     [SerializeField] | ||||
|     private bool _iOSFrameworkAdSupport = true; | ||||
|     [SerializeField] | ||||
|     private bool _iOSFrameworkAdServices = false; | ||||
|     private bool _iOSFrameworkAdServices = true; | ||||
|     [SerializeField] | ||||
|     private bool _iOSFrameworkAppTrackingTransparency = false; | ||||
|     private bool _iOSFrameworkAppTrackingTransparency = true; | ||||
|     [SerializeField] | ||||
|     private bool _iOSFrameworkStoreKit = false; | ||||
|     [SerializeField] | ||||
|  |  | |||
|  | @ -13,6 +13,8 @@ namespace Guru.Editor.Adjust | |||
|         private static string CodeReplaceSample = | ||||
|             "AssetDatabase.GUIDToAssetPath(guids[0]).Replace(\"AdjustSettings.cs\", \"AdjustSettings.asset\")"; | ||||
| 
 | ||||
|         private static string CodeIOSFrameworkAdServices = "private bool _iOSFrameworkAdServices"; | ||||
|         private static string CodeIOSFrameworkATT = "private bool _iOSFrameworkAppTrackingTransparency"; | ||||
|          | ||||
|          | ||||
|          | ||||
|  | @ -74,6 +76,21 @@ namespace Guru.Editor.Adjust | |||
|             for (int i = 0; i < lines.Count; i++) | ||||
|             { | ||||
|                 line = lines[i]; | ||||
|                 if (line.Contains(CodeIOSFrameworkAdServices) && line.Contains("false")) | ||||
|                 { | ||||
|                     lines[i] = line.Replace("false", "true"); // 允许引入AdService | ||||
|                     isDirty = true; | ||||
|                     continue; | ||||
|                 } | ||||
|                  | ||||
|                 if (line.Contains(CodeIOSFrameworkATT) && line.Contains("false")) | ||||
|                 { | ||||
|                     lines[i] = line.Replace("false", "true"); // 允许引入AdService | ||||
|                     isDirty = true; | ||||
|                     continue; | ||||
| 
 | ||||
|                 } | ||||
|                  | ||||
|                 if (line.Contains(CodeReplaceSample) && !line.Contains("//")) | ||||
|                 { | ||||
|                     lines[i] = $"//{line}"; | ||||
|  |  | |||
|  | @ -1,10 +1,9 @@ | |||
| namespace Guru.Editor.Adjust | ||||
| { | ||||
|     using System.IO; | ||||
|     using UnityEditor; | ||||
|     using UnityEngine; | ||||
| 
 | ||||
| namespace Guru.Editor.Adjust | ||||
| { | ||||
|      | ||||
|     /// <summary> | ||||
|     /// 修改器API | ||||
|     /// </summary> | ||||
|  | @ -24,7 +23,7 @@ namespace Guru.Editor.Adjust | |||
|             get | ||||
|             { | ||||
| #if GURU_SDK_DEV | ||||
|                 return $"__upm/{PackageName}/Adjust/Editor";   | ||||
|                 return $"__packages/{PackageName}/Adjust/Editor";   | ||||
| #endif | ||||
|                 return $"Packages/{PackageName}/Adjust/Editor"; | ||||
|             } | ||||
|  | @ -85,23 +84,25 @@ namespace Guru.Editor.Adjust | |||
| 
 | ||||
|             // Make a new one | ||||
|             var settings = ScriptableObject.CreateInstance<AdjustSettings>(); | ||||
|             SerializedObject so = new SerializedObject(settings); | ||||
|             SerializedProperty p; | ||||
|             p = so.FindProperty("m_EditorClassIdentifier._iOSFrameworkAdSupport"); // 引入 AdSupport | ||||
|             if (p != null)  p.boolValue = true; | ||||
|             p = so.FindProperty("m_EditorClassIdentifier._iOSFrameworkAdServices"); // 引入 AdServices | ||||
|             if (p != null)  p.boolValue = true; | ||||
|             so.ApplyModifiedProperties(); | ||||
|             AssetDatabase.CreateAsset(settings, AdjustSettingsAssetPath); | ||||
|             AssetDatabase.SaveAssetIfDirty(settings); | ||||
|             AssetDatabase.Refresh(); | ||||
| 
 | ||||
|             Debug.Log($"[Guru] <color=#88ff00>--- Create AdjustSettings at:</color> \n{AdjustSettingsAssetPath}"); | ||||
| 
 | ||||
|             return settings; | ||||
|         } | ||||
|          | ||||
|         #endregion | ||||
|          | ||||
| 
 | ||||
|         public static void ApllyMods() | ||||
|         public static void ApplyMods() | ||||
|         { | ||||
|              | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|     } | ||||
| } | ||||
		Loading…
	
		Reference in New Issue