Skip to content

Commit

Permalink
api refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dbejanishvili committed May 10, 2021
1 parent 1dbf217 commit 403d166
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
10 changes: 4 additions & 6 deletions Sources/MavisSDK/Mavis.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class Mavis: UIResponder, UIApplicationDelegate {
private let dataBundleId: String = "com.unity3d.framework"
private let frameworkPath: String = "/Frameworks/UnityFramework.framework"

private var mavisOptions: MavisOptions?
private var ufw : UnityFramework?
private var hostMainWindow : UIWindow?

Expand All @@ -19,21 +20,18 @@ public class Mavis: UIResponder, UIApplicationDelegate {


public static func Init(_ options : MavisOptions){
shared.setHostMainWindow(options.hostMainWindow)
shared.mavisOptions = options;
}

public static func Launch() {
public static func Launch(_ parentWindow: UIWindow?) {
shared.hostMainWindow = parentWindow
if shared.isInitialized {
shared.showWindow()
} else {
shared.initWindow()
}
}

private func setHostMainWindow(_ hostMainWindow: UIWindow?) {
self.hostMainWindow = hostMainWindow
}

private func initWindow() {
if isInitialized {
showWindow()
Expand Down
3 changes: 0 additions & 3 deletions Sources/MavisSDK/Models/MavisOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import UnityFramework

public class MavisOptions {
public var licenseKey : String = ""
public var hostMainWindow: UIWindow?

public init(){

}

}

0 comments on commit 403d166

Please sign in to comment.