Пример #1
0
        public void OnPreprocessBuild(BuildReport report)
        {
            var parameter = BuildParameter.GetActiveParameter();

            Debug.Log($"Build {report.summary.platform} Start" + Environment.NewLine + JsonUtility.ToJson(parameter));

            PlayerSettings.applicationIdentifier = parameter.BundleIdentifier;
            PlayerSettings.productName           = parameter.AppName;

            var bi = ScriptableObject.CreateInstance <BuildInformation>();

            bi.BuildDateBinary  = DateTime.Now.ToBinary();
            bi.BundleIdentifier = parameter.BundleIdentifier;
            bi.Environment      = parameter.Environment;


            bi.Save();

            SetAndroidParameters();
        }
Пример #2
0
        public static void Build()
        {
            //Clear Directory
            if (Directory.Exists(BuildDirectory))
            {
                Directory.Delete(BuildDirectory, true);
            }

            AssetDatabase.CreateFolder("", BuildDirectory);

            var target = EditorUserBuildSettings.activeBuildTarget;


            var report = BuildPipeline.BuildPlayer(GetBuildScenes(), GetBuildPath(), target, BuildEvent.GetBuildOption(BuildParameter.GetActiveParameter()));

            if (report.summary.result == UnityEditor.Build.Reporting.BuildResult.Succeeded)
            {
                return;
            }

            BuildEvent.BuildError(report, BuildParameter.GetActiveParameter());
        }
Пример #3
0
        public void OnPostprocessBuild(BuildReport report)
        {
            var parameter = BuildParameter.GetActiveParameter();

            Debug.Log("Build End" + Environment.NewLine + JsonUtility.ToJson(parameter));
        }