diff --git a/Editor/Scripts/BuildTools.cs b/Editor/Scripts/BuildTools.cs index 618fa84..a8807e2 100644 --- a/Editor/Scripts/BuildTools.cs +++ b/Editor/Scripts/BuildTools.cs @@ -5,6 +5,7 @@ using UnityEditor; using UnityEditor.Build; using UnityEditor.Build.Reporting; +using UnityEngine; namespace CandyCoded.env.Editor { @@ -28,13 +29,6 @@ public void OnPostprocessBuild(BuildReport report) public void OnPreprocessBuild(BuildReport report) { - if (File.Exists(env.runtimeFilePath)) - { - - throw new Exception($"{env.runtimeFilePath} already exists. Remove this file before continuing."); - - } - if (!Directory.Exists(env.resourcesDirPath)) { @@ -43,8 +37,14 @@ public void OnPreprocessBuild(BuildReport report) _resourcesDirCreated = true; } - - if (File.Exists(env.editorFilePath)) + + if (File.Exists(env.runtimeFilePath)) + { + + Debug.LogWarning($"{env.runtimeFilePath} already exists, using the existing file rather than copying current env."); + + } + else if (File.Exists(env.editorFilePath)) { FileUtil.CopyFileOrDirectory(env.editorFilePath, env.runtimeFilePath);