react-native icon indicating copy to clipboard operation
react-native copied to clipboard

The React Native and Unity project integration doesn't seem to work out well.

Open 406410672 opened this issue 2 years ago • 2 comments

Description

The React Native and Unity project integration doesn't seem to work out well. When I used ReactRootView to integrate into an existing Unity project, the Component layout was reversed in the vertical direction, like title was originally above and now below, as are other Component s. The same code for newly created projects with XCode.

Version

0.69.5

Output of npx react-native info

System: OS: macOS 12.6 CPU: (8) arm64 Apple M1 Memory: 137.97 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.3.0 - /opt/homebrew/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 8.11.0 - /opt/homebrew/bin/npm Watchman: 2022.06.13.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: ^18.2.0 => 18.2.0 react-native: ^0.69.5 => 0.69.5 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Integration with Existing Apps iOS & Unity

Use the code just like the following form

NSURL *jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.bundle?platform=ios"];

    RCTRootView *rootView =
      [[RCTRootView alloc] initWithBundleURL: jsCodeLocation
                                  moduleName: @"RNHighScores"
                           initialProperties:
                             @{
                               @"scores" : @[
                                 @{
                                   @"name" : @"Alex",
                                   @"value": @"42"
                                  },
                                 @{
                                   @"name" : @"Joel",
                                   @"value": @"10"
                                 }
                               ]
                             }
                               launchOptions: nil];
    UIViewController *vc = [[UIViewController alloc] init];
    vc.view = rootView;
    [self presentViewController:vc animated:YES completion:nil];

Snack, code example, screenshot, or link to a repository

Demo running under Unity, wrong position.The Test Component should be above it. IMG_5A214AE6EC26-1

On other items, the correct location. 1666348654390

406410672 avatar Oct 21 '22 10:10 406410672

The React Native and Unity project integration doesn't seem to work out well

Can you link to the documentation you've been using about Unity project integration?

cortinico avatar Oct 21 '22 15:10 cortinico

The React Native and Unity project integration doesn't seem to work out well

Can you link to the documentation you've been using about Unity project integration?

I integrated the ReactNative into the Unity project and added the RCTRootView to the UnityView. Use the following document. https://reactnative.dev/docs/integration-with-existing-apps

406410672 avatar Oct 24 '22 07:10 406410672

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 22 '23 12:04 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar May 11 '23 06:05 github-actions[bot]

Any update on this issue? I meet up with same problem.. looks like flex-start becomes flex-end, also in a unity project

monzy613 avatar Jan 29 '24 10:01 monzy613