@dolami-inc/react-native-expo-unity 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/ios/ExpoUnity.podspec +13 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -81,15 +81,17 @@ cp node_modules/@dolami-inc/react-native-expo-unity/plugin/NativeCallProxy.mm <U
|
|
|
81
81
|
|
|
82
82
|
### 3. Copy build artifacts to your RN project
|
|
83
83
|
|
|
84
|
-
Create `unity/builds/ios/` in your project root and copy:
|
|
84
|
+
Create `unity/builds/ios/` in your project root and copy all artifacts from your Unity iOS build:
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
87
|
mkdir -p unity/builds/ios
|
|
88
88
|
cp -R <unity-build>/UnityFramework.framework unity/builds/ios/
|
|
89
|
-
cp <unity-build
|
|
89
|
+
cp <unity-build>/*.a unity/builds/ios/
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
The podspec references these files **directly by path** — nothing is copied or embedded into the npm package. Updating your Unity build is as simple as replacing the contents of `unity/builds/ios/` and re-running `pod install`.
|
|
93
|
+
|
|
94
|
+
> Custom path? Set `EXPO_UNITY_PATH` environment variable pointing to your Unity build directory, or pass `unityPath` to the config plugin (see step 4).
|
|
93
95
|
|
|
94
96
|
### 4. Add the config plugin to `app.json`
|
|
95
97
|
|
package/ios/ExpoUnity.podspec
CHANGED
|
@@ -38,19 +38,22 @@ Pod::Spec.new do |s|
|
|
|
38
38
|
unity_ldflags << '-framework UnityFramework' if framework_exists
|
|
39
39
|
unity_ldflags += a_files.map { |f| "\"#{f}\"" }
|
|
40
40
|
|
|
41
|
+
# Unity framework is ARM-only (device build) — never link it for Simulator.
|
|
42
|
+
# The [sdk=iphoneos*] conditional ensures these settings only apply when
|
|
43
|
+
# building for a physical device, not the Simulator SDK.
|
|
41
44
|
s.pod_target_xcconfig = {
|
|
42
|
-
'HEADER_SEARCH_PATHS'
|
|
43
|
-
'FRAMEWORK_SEARCH_PATHS'
|
|
44
|
-
'OTHER_LDFLAGS'
|
|
45
|
-
'CLANG_CXX_LANGUAGE_STANDARD'
|
|
46
|
-
'GCC_PREPROCESSOR_DEFINITIONS'
|
|
47
|
-
'ENABLE_BITCODE'
|
|
45
|
+
'HEADER_SEARCH_PATHS' => "\"#{unity_ios_dir}/UnityFramework.framework/Headers\"",
|
|
46
|
+
'FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]' => "\"#{unity_ios_dir}\"",
|
|
47
|
+
'OTHER_LDFLAGS[sdk=iphoneos*]' => unity_ldflags.join(' '),
|
|
48
|
+
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
|
|
49
|
+
'GCC_PREPROCESSOR_DEFINITIONS' => 'UNITY_FRAMEWORK=1',
|
|
50
|
+
'ENABLE_BITCODE' => 'NO'
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
s.user_target_xcconfig = {
|
|
51
|
-
'ENABLE_BITCODE'
|
|
52
|
-
'FRAMEWORK_SEARCH_PATHS'
|
|
53
|
-
'LIBRARY_SEARCH_PATHS'
|
|
54
|
-
'OTHER_LDFLAGS'
|
|
54
|
+
'ENABLE_BITCODE' => 'NO',
|
|
55
|
+
'FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]' => "\"#{unity_ios_dir}\"",
|
|
56
|
+
'LIBRARY_SEARCH_PATHS[sdk=iphoneos*]' => "\"#{unity_ios_dir}\"",
|
|
57
|
+
'OTHER_LDFLAGS[sdk=iphoneos*]' => unity_ldflags.join(' ')
|
|
55
58
|
}
|
|
56
59
|
end
|