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,5 +1,3 @@
#import "UnityAppController.h"

extern "C" {
struct UnityAudioEffectDefinition;
typedef int (*UnityPluginGetAudioEffectDefinitionsFunc)(
Expand All @@ -9,6 +7,41 @@ extern void UnityRegisterAudioPlugin(
extern int UnityGetAudioEffectDefinitions(UnityAudioEffectDefinition*** definitionptr);
} // extern "C"

#if UNITY_XCODE_PROJECT_TYPE_SWIFT

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

@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

#else

#import "UnityAppController.h"

@interface PHASESpatializerAppController : UnityAppController
- (void)shouldAttachRenderDelegate;
@end
Expand All @@ -21,3 +54,5 @@ - (void)shouldAttachRenderDelegate

@end
IMPL_APP_CONTROLLER_SUBCLASS(PHASESpatializerAppController);

#endif