@@ -844,32 +844,40 @@ public static void SettingsDialog() {
844
844
internal static bool MultipleXcodeTargetsSupported {
845
845
get {
846
846
try {
847
- return typeof ( UnityEditor . iOS . Xcode . PBXProject ) . GetMethod (
848
- "GetUnityMainTargetGuid" , Type . EmptyTypes ) != null ;
849
- } catch ( Exception ) {
847
+ return MultipleXcodeTargetsSupportedInternal ( ) ;
848
+ } catch ( Exception e ) {
850
849
return false ;
851
850
}
852
851
}
853
852
}
854
853
854
+ private static bool MultipleXcodeTargetsSupportedInternal ( ) {
855
+ return typeof ( UnityEditor . iOS . Xcode . PBXProject ) . GetMethod (
856
+ "GetUnityMainTargetGuid" , Type . EmptyTypes ) != null ;
857
+ }
858
+
855
859
/// <summary>
856
860
/// Name of the Xcode main target generated by Unity.
857
861
/// </summary>
858
862
public static string XcodeMainTargetName {
859
863
get {
860
864
try {
861
- // NOTE: Unity-iPhone is hard coded in UnityEditor.iOS.Xcode.PBXProject and will no
862
- // longer be exposed via GetUnityTargetName(). It hasn't changed in many years though
863
- // so we'll use this constant as a relatively safe default.
864
- return MultipleXcodeTargetsSupported ? "Unity-iPhone" :
865
- ( string ) VersionHandler . InvokeStaticMethod ( typeof ( UnityEditor . iOS . Xcode . PBXProject ) ,
866
- "GetUnityTargetName" , null ) ;
867
- } catch ( Exception ) {
865
+ return XcodeMainTargetNameInternal ( ) ;
866
+ } catch ( Exception e ) {
868
867
return "Unity-iPhone" ;
869
868
}
870
869
}
871
870
}
872
871
872
+ private static string XcodeMainTargetNameInternal ( ) {
873
+ // NOTE: Unity-iPhone is hard coded in UnityEditor.iOS.Xcode.PBXProject and will no
874
+ // longer be exposed via GetUnityTargetName(). It hasn't changed in many years though
875
+ // so we'll use this constant as a relatively safe default.
876
+ return MultipleXcodeTargetsSupported ? "Unity-iPhone" :
877
+ ( string ) VersionHandler . InvokeStaticMethod ( typeof ( UnityEditor . iOS . Xcode . PBXProject ) ,
878
+ "GetUnityTargetName" , null ) ;
879
+ }
880
+
873
881
/// <summary>
874
882
/// Name of the Xcode UnityFramework target generated by Unity 2019.3+
875
883
/// </summary>
0 commit comments