| 123456789101112131415161718192021222324252627282930 |
- #if UNITY_IOS
- using System;
- using UnityEditor;
- using UnityEditor.Callbacks;
- using UnityEditor.iOS.Xcode;
- namespace HexaCrazy.Editor
- {
- static class AdMobXcodeBuild
- {
- [PostProcessBuild(1100)]
- static void ConfigureTestAds(BuildTarget target, string outputPath)
- {
- if (target != BuildTarget.iOS) return;
- string path = PBXProject.GetPBXProjectPath(outputPath);
- var project = new PBXProject();
- project.ReadFromFile(path);
- string framework = project.GetUnityFrameworkTargetGuid();
- foreach (string name in new[] { "Debug", "ReleaseForRunning", "ReleaseForProfiling" })
- {
- string config = project.BuildConfigByName(framework, name);
- if (!string.IsNullOrEmpty(config))
- project.UpdateBuildPropertyForConfig(config, "GCC_PREPROCESSOR_DEFINITIONS",
- new[] { "$(inherited)", "HEXA_ADMOB_TEST_ADS=1" }, Array.Empty<string>());
- }
- project.WriteToFile(path);
- }
- }
- }
- #endif
|