refactor: remove unused codes for Unity 2021 or lower versions
parent
52f07bc8b3
commit
0762becc28
|
|
@ -18,7 +18,6 @@
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
using HybridCLR.Installer;
|
|
||||||
using HybridCLR.Settings;
|
using HybridCLR.Settings;
|
||||||
using HybridCLR.Utils;
|
using HybridCLR.Utils;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
using HybridCLR.Installer;
|
|
||||||
using HybridCLR.Settings;
|
using HybridCLR.Settings;
|
||||||
using HybridCLR.Utils;
|
using HybridCLR.Utils;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ namespace HybridCLR.BuildProcessors
|
||||||
|
|
||||||
public int callbackOrder => 0;
|
public int callbackOrder => 0;
|
||||||
|
|
||||||
#if UNITY_2021_1_OR_NEWER
|
|
||||||
public static string GetStripAssembliesDir2021(BuildTarget target)
|
public static string GetStripAssembliesDir2021(BuildTarget target)
|
||||||
{
|
{
|
||||||
string projectDir = SettingsUtil.ProjectDir;
|
string projectDir = SettingsUtil.ProjectDir;
|
||||||
|
|
@ -89,21 +88,6 @@ namespace HybridCLR.BuildProcessors
|
||||||
default: return "";
|
default: return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
private string GetStripAssembliesDir2020(BuildTarget target)
|
|
||||||
{
|
|
||||||
string subPath = target == BuildTarget.Android ?
|
|
||||||
"assets/bin/Data/Managed" :
|
|
||||||
"Data/Managed/";
|
|
||||||
return $"{SettingsUtil.ProjectDir}/Temp/StagingArea/{subPath}";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnBeforeConvertRun(BuildReport report, Il2CppBuildPipelineData data)
|
|
||||||
{
|
|
||||||
BuildTarget target = report.summary.platform;
|
|
||||||
CopyStripDlls(GetStripAssembliesDir2020(target), target);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
public static void CopyStripDlls(string srcStripDllPath, BuildTarget target)
|
public static void CopyStripDlls(string srcStripDllPath, BuildTarget target)
|
||||||
{
|
{
|
||||||
|
|
@ -128,14 +112,12 @@ namespace HybridCLR.BuildProcessors
|
||||||
|
|
||||||
public void OnPostprocessBuild(BuildReport report)
|
public void OnPostprocessBuild(BuildReport report)
|
||||||
{
|
{
|
||||||
#if UNITY_2021_1_OR_NEWER
|
|
||||||
BuildTarget target = report.summary.platform;
|
BuildTarget target = report.summary.platform;
|
||||||
string srcStripDllPath = GetStripAssembliesDir2021(target);
|
string srcStripDllPath = GetStripAssembliesDir2021(target);
|
||||||
if (!string.IsNullOrEmpty(srcStripDllPath) && Directory.Exists(srcStripDllPath))
|
if (!string.IsNullOrEmpty(srcStripDllPath) && Directory.Exists(srcStripDllPath))
|
||||||
{
|
{
|
||||||
CopyStripDlls(srcStripDllPath, target);
|
CopyStripDlls(srcStripDllPath, target);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPreprocessBuild(BuildReport report)
|
public void OnPreprocessBuild(BuildReport report)
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ using UnityEngine;
|
||||||
|
|
||||||
namespace HybridCLR.BuildProcessors.Hooks
|
namespace HybridCLR.BuildProcessors.Hooks
|
||||||
{
|
{
|
||||||
#if UNITY_2022 || UNITY_2023_1_OR_NEWER
|
|
||||||
[InitializeOnLoad]
|
[InitializeOnLoad]
|
||||||
public class GetIl2CppFolderHook
|
public class GetIl2CppFolderHook
|
||||||
{
|
{
|
||||||
|
|
@ -68,5 +67,4 @@ namespace HybridCLR.BuildProcessors.Hooks
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue