React Native with Unity - unity3d

Does anyone have any experience combining React Native and Unity? I'm looking to start a Unity project that's very UI Heavy and I'm thinking about using React Native to take advantage of its UI capabilities on mobile and web.
I'm curious what the workflow for such an approach would be.

Finally after a lot of trials managed to do this. These are the steps.
1) Using this link, export android project for Gradle.
Select Gradle in the Build Settings window and check the Export Project checkbox.
Click Export and select the destination folder.
2) Import the generated folder in Android studio. Select ok whenever prompted. In this process, you will encounter following issues
2a) Gradle Sync Failed due to org.gradle.api.internal.tasks issues. Resolve using this link
3) Create React Native App using this link
4) Start Integrating Android exported folder inside created react native app using this link. Don't upgrade Gradle as Android studio will ask you again and again. You will encounter following issues. Don't go through "Test Integration" until you are finished with #5 here.
4a) While configuring maven, use this url for maven url "$rootDir/../node_modules/react-native/android" .
4b) While configuring maven, if you encounter problem related to javax.inject:javax.inject". Use this link.
4c) You may also encounter this error "Conflict with dependency 'com.google.code.findbugs:jsr305'". You can solve this link.
4d) During Code integration section of this link, focus on the following section: If you are using a starter kit for React Native, replace the "HelloWorld" string with the one in your index.android.js file (it’s the first argument to the AppRegistry.registerComponent() method). Here you have to replace with project name.
5) Before going through "Test your Integration" section, you have to add code to call MyReactActivity from UnityActivity. This link will help.
6) Go through "Test your Integration" section of link provided in #4. You may encounter following problems.
6a) unable to load script from assets index.android.bundle. Use this link.
6b) could not connect to development server on android. Use this link.

Check my article on Medium
I've shown with an example on How to integrate react native with Unity 3D step by step. My aim was to use the react native within the Unity3D like a module which is quite convenient if you're gonna heavily work on Unity 3D. Hope this helps for someone who comes here later.

I'm unsure as how a Unity game is built for iOS, if it uses Cocoa Touch for rendering its core classes.
If it does, and you have access or ability to render a UIViewController then you can render your React Native application. The only thing you would have to facilitate is setting up communication between the two applications.
Here is an example of rendering a native UI Component inside a React Native app that may help. http://moduscreate.com/leverage-existing-ios-views-react-native-app/

I was curious as well, and created an example project of how to do this for Android: https://github.com/marijnz/unity-react.
If this is a viable option, at least depends on:
How long the project will be running, both React and Unity have to be updated and this gets probably tougher over time.
The amount of sdk's/dependencies the project has.
If you want to do iOS as well.
In general, I'd probably avoid going this way.
Even though the example seems pretty simple now, it was a pain to get to that (as Shaunak's answer already hints at ;))

Related

Remove Web Part from Existing Flutter Project

How can I remove the web component part of a Flutter project? I have a project that when it was created was automatically created with web support. Now I am 100% certain the app won't be used for web and I just want to remove support for it. Is there a command in the terminal to help me do that?
I tried checking through the other questions but the others were asking how to disable web support altogether. I just want to remove web support on one project.
In order to fix this, I followed this link. The reason why I can't recreate the project easily is that the project has grown so much that it would be a big hassle to move it into another project. This happened after we updated all of our libraries to their latest versions respectively.
FirestoreWeb caused our project to stop compiling but since we aren't using Flutter web and we don't plan to use it for this project, it wouldn't make sense for us to implement it.
This answer was posted as an edit to the question Remove Web Part from Existing Flutter Project by the OP kobowo under CC BY-SA 4.0.

TypeLoadException after loading .NET 4.5 C# DLL into Unity 2018.2.5

I want to be able to feed the camera frames from a webcam into Unity. I made a .NET 4.5 C# DLL using MediaFrameReader and event listeners. Here is some other user's implementation for accessing the Hololens camera frames: Hololens - Access Camera Frames.
When I import the DLL into my 2018.2.5 Unity project, it gives me the following error:
Unloading broken assembly "....", this assembly can cause crashes in the runtime
TypeLoadException: Could not find method due to a type load error
The C# plugin built successfully many times on Visual Studio. Also, I have properly set the Api Compatibility Level (in player settings) to .NET 4.x. What could be the fix to this?
All the other SO answers related to this I have already taken a look, but does not seem to help the problem. Thanks for all the help.
EDIT: https://issuetracker.unity3d.com/issues/unity-fails-to-load-net-4-dot-6-assemblies-with-typeloadexception is the most relatable post, but had no solution.
I have few possible solutions for you to explore.
DLLs issues:
Workaround:
Comment your UWP code (the part that uses the DLL), then build it in UNITY without the DLL. In the generated UWP solution, install the package from nuget or manually import the dll, then uncomment your code and finish your development. This is a short-term solution.It is going to be annoying as you re-build your solution many times and have to comment/uncomment then re-add dlls and so on.
Other possible solutions:
Failed to run reference rewriter with command error with unity error when adding a DLL to the assets folder
Your exact need
From your description, you really do not need everything in the link you referenced (Hololens - Access Camera Frames). You need much simpler version. I recently created MediaCapture solution for HoloLens as a workaround because PhotoCapture in Unity is not working in the HoloLens and everything is working without any additional DLLs. I will post for you few links to see if it may help you:
MediaCapture Unity & HoloLens: https://github.com/MSAlshair/HoloLensMediaCapture
This maybe a good start for you. You can combine it with your original reference. Use this project as starting point to make sure your project is building correct, then use the necessary code from the other resource that you posted to accomplish the task that you desire. You may need to download Unity 2018.2.12f1 because I didn't test it in 2018.2.5
MediaCapture & PhotoCapture: Hololens font camera
Good Luck!

Naming audio plug-ins using JUCE framework

I've been working on developing some audio plugins recently using the JUCE framework. I'm having an issue regarding naming the plugin. I've created separate projects for entirely different plugins. However when I load the plugin by starting Logic Pro X, I seem to only get the most recent plugin that I built, however, the plugin is always title as the very first plugin that I made. That is to say, It seems that when I make a new plugin, it takes on the name of my previous plugin and replaces it.
I've tried renaming the Plugin Code, but the AU validation tool recognizes the plugin as having the Plugin Code of the previous plugin.
Has anyone come across this problem or have any suggesting as to what might be causing it?
Additionally, I was using the WDL framework before using JUCE and had the same problem. This of course makes me think that the problem is not specific to JUCE or WDL.
Any input is appreciated, Thanks!
Open the Introjucer with one of your projects and select the "Config" tab in the left panel. Then select your project at the top of the tree view.
In the right panel, you should see 2 fields called "Plugin Manufacturer Code" and "Plugin Code".
Your other project should have the same Plugin Manufacturer code, but a different Plugin Code to uniquely identify each plugin.

How to understand the code flow in nuxeo

Recently I have downloaded the Nuxeo code, SDK and Nuxio IDE for the development purpose. I am also able to do build the project run the SDK and importing project into eclipse. But as Nuxeo guys know, it's a huge project and document doesn't contains details about the Code Flow. So, I am sucked. To develop and fix bugs I need to know the existing code structure, functionality of each projects(modules/bundles) , how to identify the code flow if user click on a button. So, please help me
It depends on the UI you want to debug. If it's the JSF UI, then the buttons are usually associated with an "action" contributed from an XML file. You can then follow the thread.
Your question is too much generic to give you more details. Do look for development guidelines and/or how-to fix some bugs? In the latter case, it depends on each kind of bug, the Nuxeo version, the original code writer (Nuxeo legacy code or customized code), the use of Nuxeo Studio or not...

Import project from Eclipse to B4A?

I'm a beginner trying to learn my way through making my first real Android app. I actually started an app using Eclipse and have gotten pretty far with it. I'd like to be able to continue its development using B4A. Is it possible to bring my work from Eclipse into B4A?
What you can do, is to wrap your existing code as a library and then reference it from Basic4android. See this video tutorial.
B4A is a language on its own and it has its own editor.
While, in theory, you can edit project files of a B4A application with any editor, I would assume that you used JAVA as your main programming language.
As B4A uses a language that close resembles (Visual) Basic that, in turns gets converted into JAVA while compiling, you have actually 2 choices in front of you if you want to use B4A:
1) the first is to port your project to B4A but this means that you will need to rewrite the code according to the B4A language specifications;
2) the second option would be to integrate your JAVA code running it inline : see this forum post on the topic
2) if you can pack whatever you wrote as a library module to be used later on by B4A, you could opt to do that: see this forum post on the topic