@@ -87,23 +87,23 @@ let kCallbackTarget = "ReplayKitUnity"
87
87
// For Unity to add a default interface that will be excluded from the interface during playback
88
88
@objc func addDefaultButtonWindowForUnity( ) {
89
89
90
- if let currentVC = UnityGetGLViewController ( ) {
91
- buttonWindow = UIWindow ( frame: currentVC. view. frame)
92
- let recordVC = RecordViewController ( )
93
- recordVC. recordDuration = recordTime
94
- buttonWindow? . rootViewController = recordVC
95
- buttonWindow? . rootViewController? . view. backgroundColor = . clear
96
- buttonWindow? . makeKeyAndVisible ( )
97
- } else {
98
- assertionFailure ( " cannot get the current vc from unity " )
99
- }
90
+ // if let currentVC = UnityGetGLViewController() {
91
+ // buttonWindow = UIWindow(frame: currentVC.view.frame)
92
+ // let recordVC = RecordViewController()
93
+ // recordVC.recordDuration = recordTime
94
+ // buttonWindow?.rootViewController = recordVC
95
+ // buttonWindow?.rootViewController?.view.backgroundColor = .clear
96
+ // buttonWindow?.makeKeyAndVisible()
97
+ // } else {
98
+ // assertionFailure("cannot get the current vc from unity")
99
+ // }
100
100
}
101
101
102
102
@objc func startScreenCaptureAndSaveToFile( ) {
103
103
104
104
// Sends a message to Unity that iOS has started to record the screen
105
105
// In this Xcode Project this line will return an error since you do not have the UnityInterface file imported into this project. Once this file and the source code is dragged into Unity > Plugins> iOS folder,and you build the Xcode project it will work.
106
- UnitySendMessage ( kCallbackTarget, " OnStartRecording " , " " )
106
+ // UnitySendMessage(kCallbackTarget, "OnStartRecording", "")
107
107
108
108
let fileAppendValue = FileHandler . fetchAllReplays ( ) . count > 0 ? FileHandler . fetchAllReplays ( ) . count + 1 : 0
109
109
self . replayPath = " recording_ \( fileAppendValue) "
@@ -173,7 +173,7 @@ let kCallbackTarget = "ReplayKitUnity"
173
173
}
174
174
175
175
// Send a message to Unity with the file path itself.
176
- UnitySendMessage ( kCallbackTarget, " OnStopRecording " , file. absoluteString)
176
+ // UnitySendMessage(kCallbackTarget, "OnStopRecording", file.absoluteString)
177
177
178
178
if self ? . fileURLCallback != nil {
179
179
self ? . fileURLCallback!( file)
@@ -267,12 +267,12 @@ let kCallbackTarget = "ReplayKitUnity"
267
267
activityVC. excludedActivityTypes = [ . assignToContact, . saveToCameraRoll, . openInIBooks]
268
268
269
269
// Once this file is in your built Unity Xcode project, this function allows for you to fetch the current view controller being displayed from Unity
270
- if let currentVC = UnityGetGLViewController ( ) {
271
- activityVC. popoverPresentationController? . sourceView = currentVC. view
272
- currentVC. present ( activityVC, animated: true , completion: nil )
273
- } else {
274
- assertionFailure ( " cannot get current vc from unity " )
275
- }
270
+ // if let currentVC = UnityGetGLViewController() {
271
+ // activityVC.popoverPresentationController?.sourceView = currentVC.view
272
+ // currentVC.present(activityVC, animated: true, completion: nil)
273
+ // } else {
274
+ // assertionFailure("cannot get current vc from unity")
275
+ // }
276
276
}
277
277
278
278
}
0 commit comments