1+ #if UNITY_6000_3_OR_NEWER && UNITY_EDITOR_OSX
2+ #define NEW_IL2CPP_PATH
3+ #endif
14using System ;
25using System . Collections . Generic ;
36using System . IO ;
811using System . Text . RegularExpressions ;
912using System . Linq ;
1013using HybridCLR . Editor . Settings ;
14+ using System . Runtime . InteropServices ;
1115
1216namespace HybridCLR . Editor . Installer
1317{
@@ -33,7 +37,15 @@ public InstallerController()
3337 {
3438 _curVersion = ParseUnityVersion ( Application . unityVersion ) ;
3539 _versionManifest = GetHybridCLRVersionManifest ( ) ;
36- _curDefaultVersion = _versionManifest . versions . FirstOrDefault ( v => _curVersion . isTuanjieEngine ? v . unity_version == $ "{ _curVersion . major } -tuanjie" : v . unity_version == _curVersion . major . ToString ( ) ) ;
40+ _curDefaultVersion = _versionManifest . versions . FirstOrDefault ( v => {
41+ return _curVersion . isTuanjieEngine ? v . unity_version == $ "{ _curVersion . major } -tuanjie"
42+ #if UNITY_6000_3_OR_NEWER
43+ : v . unity_version == "6000.3.x"
44+ #else
45+ : v. unity_version == _curVersion . major . ToString ( )
46+ #endif
47+ ;
48+ } ) ;
3749 PackageVersion = LoadPackageInfo ( ) . version ;
3850 InstalledLibil2cppVersion = ReadLocalVersion ( ) ;
3951 }
@@ -127,7 +139,11 @@ public string GetMinCompatibleVersion(int majorVersion)
127139 case 2021 : return "2021.3.0" ;
128140 case 2022 : return "2022.3.0" ;
129141 case 2023 : return "2023.2.0" ;
142+ #if UNITY_6000_3_OR_NEWER
143+ case 6000 : return "6000.3.0" ;
144+ #else
130145 case 6000 : return "6000.0.0" ;
146+ #endif
131147 default : return $ "2020.3.0";
132148 }
133149 }
@@ -158,14 +174,28 @@ public CompatibleType GetCompatibleType()
158174
159175 public string Il2cppPlusLocalVersion => _curDefaultVersion ? . il2cpp_plus ? . branch ;
160176
161-
162- private string GetIl2CppPathByContentPath ( string contentPath )
177+ public string ApplicationIl2cppPath
163178 {
164- return $ "{ contentPath } /il2cpp";
179+ get
180+ {
181+ Debug . Log ( $ "application path:{ EditorApplication . applicationPath } { EditorApplication . applicationContentsPath } ") ;
182+ #if NEW_IL2CPP_PATH
183+ #if UNITY_IOS
184+ string platformDirName = "iOSSupport" ;
185+ #elif UNITY_TVOS
186+ string platformDirName = "AppleTVSupport" ;
187+ #elif UNITY_VISIONOS
188+ string platformDirName = "VisionOSPlayer" ;
189+ #else
190+ string platformDirName = "iOSSupport" ;
191+ #endif
192+ return $ "{ EditorApplication . applicationContentsPath } /../../PlaybackEngines/{ platformDirName } /il2cpp";
193+ #else
194+ return $ "{ EditorApplication . applicationContentsPath } /il2cpp";
195+ #endif
196+ }
165197 }
166198
167- public string ApplicationIl2cppPath => GetIl2CppPathByContentPath ( EditorApplication . applicationContentsPath ) ;
168-
169199 public string LocalVersionFile => $ "{ SettingsUtil . LocalIl2CppDir } /libil2cpp/hybridclr/generated/libil2cpp-version.txt";
170200
171201 private string ReadLocalVersion ( )
@@ -266,12 +296,23 @@ private void RunInitLocalIl2CppData(string editorIl2cppPath, string libil2cppWit
266296 // create LocalIl2Cpp
267297 string localUnityDataDir = SettingsUtil . LocalUnityDataDir ;
268298 BashUtil . RecreateDir ( localUnityDataDir ) ;
269-
299+ #if ! NEW_IL2CPP_PATH
270300 // copy MonoBleedingEdge
271301 BashUtil . CopyDir ( $ "{ Directory . GetParent ( editorIl2cppPath ) } /MonoBleedingEdge", $ "{ localUnityDataDir } /MonoBleedingEdge", true ) ;
272-
302+ #endif
273303 // copy il2cpp
274304 BashUtil . CopyDir ( editorIl2cppPath , SettingsUtil . LocalIl2CppDir , true ) ;
305+ #if NEW_IL2CPP_PATH
306+ string buildDir = $ "{ SettingsUtil . LocalIl2CppDir } /build";
307+ if ( RuntimeInformation . ProcessArchitecture == Architecture . Arm || RuntimeInformation . ProcessArchitecture == Architecture . Arm64 )
308+ {
309+ BashUtil . CopyDir ( $ "{ buildDir } /deploy_arm64", $ "{ buildDir } /deploy", false ) ;
310+ }
311+ else
312+ {
313+ BashUtil . CopyDir ( $ "{ buildDir } /deploy_x86_64", $ "{ buildDir } /deploy", false ) ;
314+ }
315+ #endif
275316
276317 // replace libil2cpp
277318 string dstLibil2cppDir = $ "{ SettingsUtil . LocalIl2CppDir } /libil2cpp";
0 commit comments