コード例 #1
0
        public static void OnPostProcessBuild(BuildTarget target, string path)
        {
            if (target == BuildTarget.Android)
            {
                // Only allow builds for Gradle for Android
                // Native video surfaces are broken with internal builds
                AndroidBuildSystem currentBuildSystem = EditorUserBuildSettings.androidBuildSystem;
                if (currentBuildSystem != AndroidBuildSystem.Gradle)
                {
                    throw new PlatformNotSupportedException("Audience Network SDK must be built with Gradle. " +
                                                            "Switch build system to \"Gradle (New)\" under Build Settings.");
                }

                var defaultIdentifier = "com.Company.ProductName";

                // Find application identifier (backwards compatible prior to Unity 5.6)
                if (Utility.GetApplicationIdentifier() == defaultIdentifier)
                {
                    Debug.LogError("The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.");
                }

                if (!ManifestMod.CheckManifest())
                {
                    // If something is wrong with the Android Manifest, try to regenerate it to fix it for the next build.
                    ManifestMod.GenerateManifest();
                }
            }
            else if (target == BuildTarget.iOS)
            {
                ConfigurePluginPlatforms();
            }
        }
コード例 #2
0
        public static void OnPostProcessBuild(BuildTarget target, string path)
        {
            if (target == BuildTarget.Android)
            {
                // The default Bundle Identifier for Unity does magical things that causes bad stuff to happen
                if (PlayerSettings.applicationIdentifier == "com.Company.ProductName")
                {
                    Debug.LogError("The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.");
                }

                if (!ManifestMod.CheckManifest())
                {
                    // If something is wrong with the Android Manifest, try to regenerate it to fix it for the next build.
                    ManifestMod.GenerateManifest();
                }
            }
            else if (target == BuildTarget.iOS)
            {
                ConfigurePluginPlatforms();
            }
        }
コード例 #3
0
        public static void OnPostProcessBuild(BuildTarget target, string path)
        {
            // Unity renamed build target from iPhone to iOS in Unity 5, this keeps both versions happy
            if (target.ToString() == "iOS" || target.ToString() == "iPhone")
            {
                UpdatePlist(path);
            }

            if (target == BuildTarget.Android)
            {
                // The default Bundle Identifier for Unity does magical things that causes bad stuff to happen
                if (PlayerSettings.bundleIdentifier == "com.Company.ProductName")
                {
                    Debug.LogError("The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.");
                }

                if (!ManifestMod.CheckManifest())
                {
                    // If something is wrong with the Android Manifest, try to regenerate it to fix it for the next build.
                    ManifestMod.GenerateManifest();
                }
            }
        }
コード例 #4
0
        public static void OnPostProcessBuild(BuildTarget target, string path)
        {
            if (target == BuildTarget.Android)
            {
                var defaultIdentifier = "com.Company.ProductName";

                // Find application identifier (backwards compatible prior to Unity 5.6)
                if (Utility.GetApplicationIdentifier() == defaultIdentifier)
                {
                    Debug.LogError("The default Unity Bundle Identifier (com.Company.ProductName) will not work correctly.");
                }

                if (!ManifestMod.CheckManifest())
                {
                    // If something is wrong with the Android Manifest, try to regenerate it to fix it for the next build.
                    ManifestMod.GenerateManifest();
                }
            }
            else if (target == BuildTarget.iOS)
            {
                ConfigurePluginPlatforms();
            }
        }