Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,8 @@ public static string GetPbxProjectPath(BuildTarget buildTarget, string pathToBui
{
case BuildTarget.iOS:
case BuildTarget.tvOS:
return $"{pathToBuiltProject}/Unity-iPhone.xcodeproj/project.pbxproj";
case BuildTarget.VisionOS:
return $"{pathToBuiltProject}/Unity-VisionOS.xcodeproj/project.pbxproj";
return PBXProject.GetPBXProjectPath(pathToBuiltProject);
case BuildTarget.StandaloneOSX:
#if UNITY_2020_1_OR_NEWER
return $"{pathToBuiltProject}/{new DirectoryInfo(pathToBuiltProject).Name}.xcodeproj/project.pbxproj";
Expand All @@ -335,6 +334,15 @@ public static string GetPbxProjectPath(BuildTarget buildTarget, string pathToBui
}
}

/// <summary>
/// Utility method for getting the path of the .xcodeproj bundle Unity generated in provided build project path
/// </summary>
public static string GetGeneratedXcodeProjectPath(BuildTarget buildTarget, string pathToBuiltProject)
{
var pbxProjectPath = GetPbxProjectPath(buildTarget, pathToBuiltProject);
return pbxProjectPath == null ? null : Path.GetDirectoryName(pbxProjectPath);
}

/// <summary>
/// Utility method for getting a PBXProject object associated with the provided BuildTarget and built project path
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public override void OnBeginPostProcess(AppleBuildProfile appleBuildProfile, Bui
project.WriteToFile(projectPath);
}

var xcSettingsPath = $"{pathToBuiltProject}/Unity-iPhone.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings";
var xcodeProjectPath = AppleBuild.GetGeneratedXcodeProjectPath(buildTarget, pathToBuiltProject);
var xcSettingsPath = $"{xcodeProjectPath}/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings";
// Change the xcode project to use the new build system.
var xcSettingsDoc = new PlistDocument();
if (File.Exists(xcSettingsPath))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// ObjC project type counterpart of PHASESpatializerSwiftRegistration.mm.
//
// This file is masked to "XcodeProjectType: ObjectiveC" in its .meta, so exactly one of the two
// registration files is compiled into any given Xcode project.

#import "UnityAppController.h"

extern "C" {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Swift project type counterpart of PHASESpatializerAppController.mm.
//
// This file is masked to "XcodeProjectType: Swift" in its .meta, so exactly one of the two
// registration files is compiled into any given Xcode project.

#import <Foundation/Foundation.h>
#import <UnityAPI/UnityAPI-Swift.h>

extern "C" {
struct UnityAudioEffectDefinition;
typedef int (*UnityPluginGetAudioEffectDefinitionsFunc)(
struct UnityAudioEffectDefinition*** descptr);
extern void UnityRegisterAudioPlugin(
UnityPluginGetAudioEffectDefinitionsFunc getAudioEffectDefinitions);
extern int UnityGetAudioEffectDefinitions(UnityAudioEffectDefinition*** definitionptr);
} // extern "C"


@interface PHASESpatializerRegistration : NSObject
@end

@implementation PHASESpatializerRegistration

static id sPHASERuntimeInitObserver = nil;

+ (void)load
{
sPHASERuntimeInitObserver =
[[NSNotificationCenter defaultCenter] addObserverForName:UnityNotifications.unityDidInitializeRuntime
object:nil
queue:nil
usingBlock:^(NSNotification* note) {
UnityRegisterAudioPlugin(UnityGetAudioEffectDefinitions);

if (sPHASERuntimeInitObserver != nil)
{
[[NSNotificationCenter defaultCenter] removeObserver:sPHASERuntimeInitObserver];
sPHASERuntimeInitObserver = nil;
}
}];
}

@end

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.