├── .nvmrc ├── .husky ├── .npmignore ├── pre-commit └── commit-msg ├── example ├── .watchmanconfig ├── app.json ├── .bundle │ └── config ├── android │ ├── app │ │ ├── debug.keystore │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── drawable │ │ │ │ │ │ └── rn_edit_text_material.xml │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ │ └── MainApplication.java │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ ├── AndroidManifest.xml │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── release │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── ReactNativeFlipper.java │ │ ├── proguard-rules.pro │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ ├── build.gradle │ ├── gradle.properties │ ├── gradlew.bat │ └── gradlew ├── .prettierrc ├── ios │ ├── example │ │ ├── Images.xcassets │ │ │ ├── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── AppDelegate.h │ │ ├── main.m │ │ ├── AppDelegate.mm │ │ ├── Info.plist │ │ └── LaunchScreen.storyboard │ ├── example.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── .xcode.env │ ├── exampleTests │ │ ├── Info.plist │ │ └── exampleTests.m │ ├── Podfile │ ├── example.xcodeproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── example.xcscheme │ └── Podfile.lock ├── .prettierrc.js ├── Gemfile ├── index.js ├── metro.config.js ├── tsconfig.json ├── unity │ └── Assets │ │ ├── Plugins │ │ └── iOS │ │ │ ├── NativeCallProxy.h │ │ │ └── NativeCallProxy.mm │ │ └── ButtonBehavior.cs ├── __tests__ │ └── App.test.tsx ├── src │ ├── App.tsx │ ├── Main.tsx │ └── Unity.tsx ├── babel.config.js ├── jest.config.js ├── .gitignore ├── .eslintrc.js ├── package.json ├── Gemfile.lock └── README.md ├── app.plugin.js ├── src ├── __tests__ │ └── index.test.tsx ├── index.ts ├── specs │ └── UnityViewNativeComponent.ts └── UnityView.tsx ├── .gitattributes ├── docs ├── step1.jpg ├── step2.jpg ├── step3.jpg └── step4.jpg ├── tsconfig.build.json ├── babel.config.js ├── android ├── src │ ├── main │ │ ├── AndroidManifestNew.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── azesmwayreactnativeunity │ │ │ ├── ReactNativeUnityViewPackage.java │ │ │ ├── ReactNativeUnityView.java │ │ │ ├── UPlayer.java │ │ │ ├── ReactNativeUnity.java │ │ │ └── ReactNativeUnityViewManager.java │ ├── oldarch │ │ └── com │ │ │ └── azesmwayreactnativeunity │ │ │ └── ReactNativeUnityViewManagerSpec.java │ └── newarch │ │ └── com │ │ └── azesmwayreactnativeunity │ │ └── ReactNativeUnityViewManagerSpec.java ├── gradle.properties └── build.gradle ├── plugin ├── tsconfig.json └── src │ └── index.ts ├── .editorconfig ├── unity └── Assets │ ├── Plugins │ └── iOS │ │ ├── NativeCallProxy.h │ │ └── NativeCallProxy.mm │ └── ButtonBehavior.cs ├── .yarnrc.yml ├── lefthook.yml ├── turbo.json ├── tsconfig.json ├── .github ├── actions │ └── setup │ │ └── action.yml └── workflows │ └── ci.yml ├── scripts └── pod-install.cjs ├── .gitignore ├── LICENSE ├── react-native-unity.podspec ├── ios ├── RNUnityView.h ├── RNUnityViewManager.mm └── RNUnityView.mm ├── .circleci └── config.yml ├── package.json ├── README.md └── CONTRIBUTING.md /.nvmrc: -------------------------------------------------------------------------------- 1 | v18 2 | -------------------------------------------------------------------------------- /.husky/.npmignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /app.plugin.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./plugin/build'); -------------------------------------------------------------------------------- /src/__tests__/index.test.tsx: -------------------------------------------------------------------------------- 1 | it.todo('write a test'); 2 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } 5 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import UnityView from './UnityView'; 2 | 3 | export default UnityView; 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | # specific for windows script files 3 | *.bat text eol=crlf -------------------------------------------------------------------------------- /docs/step1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/docs/step1.jpg -------------------------------------------------------------------------------- /docs/step2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/docs/step2.jpg -------------------------------------------------------------------------------- /docs/step3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/docs/step3.jpg -------------------------------------------------------------------------------- /docs/step4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/docs/step4.jpg -------------------------------------------------------------------------------- /example/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "extends": "./tsconfig", 4 | "exclude": ["example"] 5 | } 6 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn lint && yarn typescript 5 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn commitlint -E HUSKY_GIT_PARAMS 5 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifestNew.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/debug.keystore -------------------------------------------------------------------------------- /example/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "none", 4 | "semi": false, 5 | "printWidth": 200 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : RCTAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | Unity_kotlinVersion=1.8.0 2 | Unity_minSdkVersion=26 3 | Unity_targetSdkVersion=33 4 | Unity_compileSdkVersion=33 5 | Unity_ndkversion=23.1.7779620 6 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azesmway/react-native-unity/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: true, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'none', 6 | semi: false, 7 | arrowParens: 'avoid' 8 | }; 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | Game view 4 | 5 | -------------------------------------------------------------------------------- /example/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby ">= 2.6.10" 5 | 6 | gem 'cocoapods', '~> 1.13' 7 | gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' 8 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import { AppRegistry } from 'react-native' 6 | 7 | import { name as appName } from './app.json' 8 | import App from './src/App' 9 | 10 | AppRegistry.registerComponent(appName, () => App) 11 | -------------------------------------------------------------------------------- /plugin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "expo-module-scripts/tsconfig.plugin", 3 | "compilerOptions": { 4 | "outDir": "build", 5 | "rootDir": "src" 6 | }, 7 | "include": ["./src"], 8 | "exclude": ["**/__mocks__/*", "**/__tests__/*"] 9 | } -------------------------------------------------------------------------------- /example/ios/example/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | 9 | indent_style = space 10 | indent_size = 2 11 | 12 | end_of_line = lf 13 | charset = utf-8 14 | trim_trailing_whitespace = true 15 | insert_final_newline = true 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config') 2 | 3 | /** 4 | * Metro configuration 5 | * https://facebook.github.io/metro/docs/configuration 6 | * 7 | * @type {import('metro-config').MetroConfig} 8 | */ 9 | const config = {} 10 | 11 | module.exports = mergeConfig(getDefaultConfig(__dirname), config) 12 | -------------------------------------------------------------------------------- /example/tsconfig.json: -------------------------------------------------------------------------------- 1 | // prettier-ignore 2 | { 3 | "extends": "@tsconfig/react-native/tsconfig.json", 4 | "compilerOptions": { 5 | "baseUrl": "./" /* Base directory to resolve non-absolute module names. */, 6 | "paths": { 7 | "*": ["src/*"] 8 | } 9 | }, 10 | "exclude": [ 11 | "node_modules", "babel.config.js", "metro.config.js", "jest.config.js" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /unity/Assets/Plugins/iOS/NativeCallProxy.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol NativeCallsProtocol 4 | @required 5 | 6 | - (void) sendMessageToMobileApp:(NSString*)message; 7 | 8 | @end 9 | 10 | __attribute__ ((visibility("default"))) 11 | @interface FrameworkLibAPI : NSObject 12 | 13 | +(void) registerAPIforNativeCalls:(id) aApi; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /example/unity/Assets/Plugins/iOS/NativeCallProxy.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @protocol NativeCallsProtocol 4 | @required 5 | 6 | - (void) sendMessageToMobileApp:(NSString*)message; 7 | 8 | @end 9 | 10 | __attribute__ ((visibility("default"))) 11 | @interface FrameworkLibAPI : NSObject 12 | 13 | +(void) registerAPIforNativeCalls:(id) aApi; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | nmHoistingLimits: workspaces 3 | 4 | plugins: 5 | - path: scripts/pod-install.cjs 6 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs 7 | spec: "@yarnpkg/plugin-interactive-tools" 8 | - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs 9 | spec: "@yarnpkg/plugin-workspace-tools" 10 | 11 | yarnPath: .yarn/releases/yarn-3.6.1.cjs 12 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | 3 | include ':unityLibrary' 4 | project(':unityLibrary').projectDir=new File('..\\unity\\builds\\android\\unityLibrary') 5 | 6 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 7 | include ':app' 8 | includeBuild('../node_modules/@react-native/gradle-plugin') 9 | -------------------------------------------------------------------------------- /lefthook.yml: -------------------------------------------------------------------------------- 1 | pre-commit: 2 | parallel: true 3 | commands: 4 | lint: 5 | files: git diff --name-only @{push} 6 | glob: "*.{js,ts,jsx,tsx}" 7 | run: npx eslint {files} 8 | types: 9 | files: git diff --name-only @{push} 10 | glob: "*.{js,ts, jsx, tsx}" 11 | run: npx tsc --noEmit 12 | commit-msg: 13 | parallel: true 14 | commands: 15 | commitlint: 16 | run: npx commitlint --edit 17 | -------------------------------------------------------------------------------- /example/__tests__/App.test.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native' 6 | 7 | // Note: import explicitly to use the types shiped with jest. 8 | import { it } from '@jest/globals' 9 | import React from 'react' 10 | // Note: test renderer must be required after react-native. 11 | import renderer from 'react-test-renderer' 12 | 13 | import App from '../src/App' 14 | 15 | it('renders correctly', () => { 16 | renderer.create() 17 | }) 18 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /unity/Assets/Plugins/iOS/NativeCallProxy.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "NativeCallProxy.h" 3 | 4 | @implementation FrameworkLibAPI 5 | 6 | id api = NULL; 7 | +(void) registerAPIforNativeCalls:(id) aApi 8 | { 9 | api = aApi; 10 | } 11 | 12 | @end 13 | 14 | extern "C" 15 | { 16 | void sendMessageToMobileApp(const char* message) 17 | { 18 | return [api sendMessageToMobileApp:[NSString stringWithUTF8String:message]]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /example/unity/Assets/Plugins/iOS/NativeCallProxy.mm: -------------------------------------------------------------------------------- 1 | #import 2 | #import "NativeCallProxy.h" 3 | 4 | @implementation FrameworkLibAPI 5 | 6 | id api = NULL; 7 | +(void) registerAPIforNativeCalls:(id) aApi 8 | { 9 | api = aApi; 10 | } 11 | 12 | @end 13 | 14 | extern "C" 15 | { 16 | void sendMessageToMobileApp(const char* message) 17 | { 18 | return [api sendMessageToMobileApp:[NSString stringWithUTF8String:message]]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /example/ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import { NavigationContainer } from '@react-navigation/native' 2 | import { createNativeStackNavigator } from '@react-navigation/native-stack' 3 | import React from 'react' 4 | 5 | import Main from './Main' 6 | import Unity from './Unity' 7 | 8 | const Stack = createNativeStackNavigator() 9 | 10 | export default function App() { 11 | return ( 12 | 13 | 14 | 15 | 16 | 17 | 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset', '@babel/preset-typescript'], 3 | env: { 4 | production: {} 5 | }, 6 | plugins: [ 7 | 'module:react-native-dotenv', 8 | '@babel/plugin-proposal-export-namespace-from', 9 | [ 10 | 'module-resolver', 11 | { 12 | root: ['./src'], 13 | alias: { '^~(.+)': './src/\\1' }, 14 | extensions: ['.ios.js', '.android.js', '.ios.ts', '.android.ts', '.ios.tsx', '.android.tsx', '.js', '.ts', '.tsx', '.json'] 15 | } 16 | ], 17 | 'react-native-reanimated/plugin' 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /example/src/Main.tsx: -------------------------------------------------------------------------------- 1 | import { StackActions, useNavigation } from '@react-navigation/native' 2 | import * as React from 'react' 3 | import { Button, Text, View } from 'react-native' 4 | 5 | const Main = () => { 6 | const navigation = useNavigation() 7 | 8 | return ( 9 | 10 | Unity Screen 11 |