swift-unity | Sample code that integrate Unity | iOS library
kandi X-RAY | swift-unity Summary
kandi X-RAY | swift-unity Summary
Sample code that integrate Unity (2017.1+) scene into iOS (Swift 4.0, Xcode 9+) project.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of swift-unity
swift-unity Key Features
swift-unity Examples and Code Snippets
Community Discussions
Trending Discussions on swift-unity
QUESTION
I am trying to add a Unity game in an existing iOS app with this Tutorial (https://github.com/jiulongw/swift-unity) from Github.
After struggeling with a lot of other errors now I come to the error:
'RegisterMonoModules.h' file not found
And of course, in my Unity game folder, there is no RegisterMonoModules.h file. There is only RegisterMonoModules.cpp file. And if I change the filetyp from ".h" to ".cpp" the file will be found, but it doesn't include the function "RegisterMonoModules()".
I searched and found that this error depends on the fact, that I used il2cpp as scripting background in Unity.
How do I solve this problem?
...ANSWER
Answered 2019-Sep-06 at 08:09The RegisterMonoModules.h
is located in the Libraries
subfolder of the Xcode-Project (the one that copies all the files from the unity-exported-xcode-project) after copying from the unity-exported-xcode-project.
You need to add Libraries/RegisterMonoModules.cpp
to your Target.
You can check this in the Xcode inspector, after selecting the file, look if there is a checkmark at Target Membership
.
Following files from the Libraries
folder must have the Target Membership
set:
Libraries/Il2CppOptions.cpp
Libraries/RegisterFeatures.cpp
Libraries/RegisterMonoModules.cpp
QUESTION
Using Unity 2019.3.0f3 and its Unity as a library
feature I'm trying to embed a Unity project inside my iOS application.
Unity officially only supports full screen rendering. Nevertheless I'm looking for a way around that restriction.
In previous versions of Unity i successfully used swift-unity to do the integration. Within this approach it is easy to just get the View where Unity is rendering to (using UnityGetGLView()
). I had no problems regarding stability or resources.
Using the new library approach, every time I try to access the UnityView
, unity forces it's complete Window
as keyWindow
.
I tried accessing the UnityView in my own ViewController using
...ANSWER
Answered 2020-Jan-13 at 11:28I found a solution to the problem based on this approach from the unity forum. Using this approach I'm able to use the UnityViewController
as a child in my own TabBarController
.
The approach is working for Unity 2019.3.0f3, but I'm not sure if it will work in future versions. It feels like Unity tries to actively prevent such use. Then again I found hints in comments in the library-code that would suggest that a modified ViewController-Hierarchy was at least contemplated e.g. in UnityAppController+ViewHandling.h
. But the instructions are unclear and methods with the hinted names don't exist.
UnityEmbeddedSwift.swift
The official example App provided by Unity is a real mess. I ended up using the UnityEmbeddedSwift.swift
from the linked forum post with additions for pausing. This class encapsulates all Unity-related functionality in one clean class.
QUESTION
I am trying to embed a Unity project(with Vuforia and map box) in an existing IOS project. I followed steps from :
- https://github.com/blitzagency/ios-unity5
- https://github.com/jiulongw/swift-unity
- https://the-nerd.be/2015/11/13/integrate-unity-5-in-a-native-ios-app-with-xcode-7/
However, at the end, I am getting errors undefined symbols for architecture arm64
, and seems like it has trouble with libVuforiaWrapper.a
which is a unity file.
The detailed error is following:
...ANSWER
Answered 2018-Jul-26 at 21:16I have found the solution for this. You have to add a Vuforia.framework on your project.
look at this website to get an basic idea to use vuforia.framework
https://library.vuforia.com/articles/Solution/Getting-Started-with-Vuforia-for-iOS-Development.html
and for working on your project, you should go website below and follow the steps in section "building in Xcode"
https://library.vuforia.com/articles/Solution/how-migrate-vuforia-7_2.html
QUESTION
Currently I'm following this tutorial to integrate Unity+Vuforia project to my existing iOS project. I manage to be able to show the Unity view inside my ARViewController. The thing is I lost all the user interaction in my view controller: my touch event for back button not fire up.
...ANSWER
Answered 2018-Jun-18 at 08:45I had the same issue but moving Unity configuration to the end of applicationDidFinishLaunchingWithOption
method didn't solve it and I still had a UIWindow in front of my screen that steals all user interactions.
My solution is not to create a new window in UnityAppController.mm
, but using the current application keyWindow.
Replace:
QUESTION
I am trying to join native iOS project and Unity project, exported for iOS. There seems to be a solution: https://github.com/jiulongw/swift-unity
But I am a bit confused by this sentence:
Simply add the post build script to your Unity project (it needs to be an editor script), and update the Xcode project location if needed.
What does it mean?
...ANSWER
Answered 2017-Oct-23 at 14:15The script that they're talking about: link needs to be added to your project as an editor script.
Unity considers any scripts that exist in folders called "Editor" as being editor scripts. So save that inside an "Editor" folder.
You want to go through that script and edit all the fields there to values that match your project. For example these two:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install swift-unity
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page