Skip to content

Cixelyn/react-native-unity-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-unity

Now only supports iOS, Android will also support in the future.

Requirements

Unity 2019.3.0a3+

React Native 0.60

Getting started (iOS)

Install library react-native-unity

npm install react-native-unity --save
react-native link react-native-unity

Manual installation

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-unity and add RNUnity2019.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNUnity2019.a to your project's Build PhasesLink Binary With Libraries

Project setting

  1. Create UnityProject with Unity 2019.3.0a3 +
  2. Open UnityProject folder in Unity and export the project to the folder UnityProject and save as ios.
  3. Add ios project(from step 2) to your workspace
  4. Update items required for use with UnityFramework.framework (these steps are required any time you re-export your ios project from Unity):
    • Add UnityFramework.framework to Embedded Binaries
      • add Unity-iPhone/Products/UnityFramework.framework to Embedded Binaries (this will also add as Linked Framework, which we remove next step)
      • remove UnityFramework.framework from Linked Frameworks and Libraries ( select it and press "-" )
    • Select Unity-iPhone / Libraries / Plugins / iOS / NativeCallProxy.h and enable UnityFramework in Target Membership and set Public**
    • Select Unity-iPhone / Data and swap Target Membership to UnityFramework from Unity-iPhone**
  5. Set "Header Search Path" of libRNUnity2019.a under the Pods project to point to UnityFramework.framework
  6. Run your project (Cmd+R)<

Usage

import RNUnityView from 'react-native-unity';

          <RNUnityView style={{left: 50, top: -20, width: 300, height: 400}} />

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C++ 47.0%
  • Objective-C 21.7%
  • Java 19.3%
  • Ruby 8.9%
  • JavaScript 3.1%