@@ -5,27 +5,35 @@ namespace Immutable.Browser.Core
5
5
{
6
6
public static class GameBridge
7
7
{
8
+ private const string SCHEME_FILE = "file:///" ;
9
+ private const string PASSPORT_DATA_DIRECTORY_NAME = "/ImmutableSDK/Runtime/Passport" ;
10
+ private const string PASSPORT_HTML_FILE_NAME = "/index.html" ;
11
+ private const string PASSPORT_PACKAGE_RESOURCES_DIRECTORY = "Packages/com.immutable.passport/Runtime/Resources" ;
12
+ private const string ANDROID_DATA_DIRECTORY = "android_asset" ;
13
+ private const string MAC_DATA_DIRECTORY = "/Resources/Data" ;
14
+ private const string MAC_EDITOR_RESOURCES_DIRECTORY = "Packages/com.immutable.passport/Runtime/Resources" ;
15
+
8
16
public static string GetFilePath ( )
9
17
{
10
18
string filePath = "" ;
11
19
#if UNITY_ANDROID && ! UNITY_EDITOR
12
20
// Android device
13
- filePath = Constants . SCHEME_FILE + ANDROID_DATA_DIRECTORY + Constants . PASSPORT_DATA_DIRECTORY_NAME + Constants . PASSPORT_HTML_FILE_NAME ;
21
+ filePath = SCHEME_FILE + ANDROID_DATA_DIRECTORY + PASSPORT_DATA_DIRECTORY_NAME + PASSPORT_HTML_FILE_NAME ;
14
22
#elif UNITY_EDITOR_OSX
15
23
// macOS editor
16
- filePath = Constants . SCHEME_FILE + Path . GetFullPath ( MAC_EDITOR_RESOURCES_DIRECTORY ) + Constants . PASSPORT_HTML_FILE_NAME ;
24
+ filePath = SCHEME_FILE + Path . GetFullPath ( MAC_EDITOR_RESOURCES_DIRECTORY ) + PASSPORT_HTML_FILE_NAME ;
17
25
#elif UNITY_STANDALONE_OSX
18
26
// macOS
19
- filePath = Constants . SCHEME_FILE + Path . GetFullPath ( Application . dataPath ) + MAC_DATA_DIRECTORY + Constants . PASSPORT_DATA_DIRECTORY_NAME + Constants . PASSPORT_HTML_FILE_NAME ;
27
+ filePath = SCHEME_FILE + Path . GetFullPath ( Application . dataPath ) + MAC_DATA_DIRECTORY + PASSPORT_DATA_DIRECTORY_NAME + PASSPORT_HTML_FILE_NAME ;
20
28
filePath = filePath . Replace ( " " , "%20" ) ;
21
29
#elif UNITY_IPHONE
22
30
// iOS device
23
- filePath = Path . GetFullPath ( Application . dataPath ) + Constants . PASSPORT_DATA_DIRECTORY_NAME + Constants . PASSPORT_HTML_FILE_NAME ;
31
+ filePath = Path . GetFullPath ( Application . dataPath ) + PASSPORT_DATA_DIRECTORY_NAME + PASSPORT_HTML_FILE_NAME ;
24
32
#elif UNITY_EDITOR_WIN
25
33
// Windows editor
26
- filePath = Constants . SCHEME_FILE + Path . GetFullPath ( $ "{ Constants . PASSPORT_PACKAGE_RESOURCES_DIRECTORY } { Constants . PASSPORT_HTML_FILE_NAME } ") ;
34
+ filePath = SCHEME_FILE + Path . GetFullPath ( $ "{ PASSPORT_PACKAGE_RESOURCES_DIRECTORY } { PASSPORT_HTML_FILE_NAME } ") ;
27
35
#else
28
- filePath = Constants . SCHEME_FILE + Path . GetFullPath ( Application . dataPath ) + Constants . PASSPORT_DATA_DIRECTORY_NAME + Constants . PASSPORT_HTML_FILE_NAME ;
36
+ filePath = SCHEME_FILE + Path . GetFullPath ( Application . dataPath ) + PASSPORT_DATA_DIRECTORY_NAME + PASSPORT_HTML_FILE_NAME ;
29
37
#endif
30
38
return filePath ;
31
39
}
0 commit comments