Unity UI components have only missing scripts - unity3d

I have a problem with native Unity components. In my project all UI objects are getting initialized with missing scripts. All Event System components, everything connected with UI.
New empty project works fine, which leads me to the idea, that something is wrong with my current project.
Any idea how to fix it?

Because Unity hasn't imported UI to your project. I had this problem too. Close your project. Just delete temp and library folder and reopen project. this time unity will import this UI library.

Related

How would I go about adding libraries to iOS app

Im brand new to iOS development, and Im in a conundrum. I need to add an iOS library from Github into my project to use. However, it does not support Carthage or CocoaPods.
I have tried dragging and dropping the source files into my project, but have had no luck. Ive even tried dragging the entire 'Source' folder into the project, but with the same results.The most common error occurs when I have added the files into my file structure like so:
The error is: Cannot find MathExprParser in scope.
The link to the Git repo is this: https://github.com/softyde/MathExprParser.
I don't really know what Im doing in this respect, Im used to using CocoaPods and Cartfile...
Note Parser.swift, Scanner.swift, and String+Char.swift are the files in question.
EXPRTESTING is my main project, not part of a workspace.
This was unfortunately, an act of stupidity... =(
According to the repo, you have to copy and past some items into the project structure. I copied the entire folder MathExprParser into my project.
Now, I had tried this before, but I was hung up on trying to import the MathExprParser module.
I realized that since the classes I needed to use were physically inside the project, I didn't need to import it, or use MathExprParser.Parse. I could use just Parse().

I'm trying to learn c# using some unity classes but I'm having some problems

I'm taking a class on making 2d games in unity, but unity won't open the game file. The error message is: Project path does not exist C:\users\Ohy0y\oneDrive\unity\NewUnityProject. Please note that the unity folder is not official, it is made by me. I have updated unity, deleted every previous version of unity, and tried to redirect the path into an empty folder.
This is my first day learning unity so I may be missing something obvious, please answer if possible!
A "game file" does not exist in Unity. In Unity, you have a specific folder structure. The project folder is the folder your Assets, ProjectSettings, Packages,... folder is inside.
In Unity Hub, remove the project you are trying to open from the list of projects and add it again by chosing your project folder (the one containing the Asset folder and such).
If that doesn't work for you, please specify why and try the following step:
In your project folder go into the ProjectSettings folder and open the file "ProjectVersion.txt" and tell me what the first line sais (m_EditorVersion: xxx). This is the project version, i.e. what Unity Version was used to create the project. That version should match the Untiy version you have installed.
Also, gernerally speaking, Unity Answers is the better platform for you to get quick answers to simple Unity related questions.
If you want to run your Game (Game File), you need to create a build first.
But of course you need to build a working scene first. If you have problems just opening the project with unity, i would try making a new project outside onedrive.

Project looking for own DLL in another project

I'm currently trying to move a solution with multiple projects from VS 2015 to VS 2019.It consists of one application and a couple of class libraries, target framework for each is .net 4.5.1. I have made a local copy of the solution to do this.
Most of the projects compile without a problem, but some of the one that are used as AddIns for the application don't.
When trying to build, doesn't matter if the projects by themselves or the whole solution, it fails because it's looking for itself. In my example picture, the project ZZ_WPF_Bank_AddIn is, while trying to build, is looking for the ZZ_WPF_Bank_AddIn in the bin folder of another project in the solution.
I tried just copying the dll from the original project, to see what happens, but it just points to the same dll missing in another project.
Has someone encountered this behaviour before? I tried googling it, but couldn't find anything useful.enter image description here
For anyone who might stumble upon this:
The solution to my problem was removing all references to projects inside the solution and adding them via Browse, noch via the projects tab on the left side. For some reason the bindings were not working properly after the migration.

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!

React Native with Unity

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 ;))