Xcode hook up with Unity - iphone

Hi i am new bee in Unity but i have 1 year experience in Xcode, I am doing an app in Unity for iPhone but getting bit confuse on how can i hook-up Xcode with Unity, I want to Facebook sharing, Twitter Sharing and also iOS native Email sharing(Using Mail Composer) in Unity but i don't get any help ful solution to do task in Unity, I only get Plugins which i need to Purchase first. So i want to do this task in Xcode it reduce and time and money and rest of work on Unity so is this possible that we can Communicate between Xcode and Unity? If Possible then kindly share some knowledge and links with me so that i can do this task ASAP.
Thanks in Advance.

You can start write your own plugin to complete the communication between Unity3D and iOS.
From iOS to Unity, You can just use UnitySendMessage, which is enough in most of time. You can also try to use a event and delegate in Unity Script to handle more complex situation.
From Unity to iOS, you need to implement plugin yourself. First of all, use a .cs file to declare the external method. And then implement the native code in a .mm file in Xcode and "extern C" them to the Unity. Then you can call the .cs method and get a native function called. You need a Unity Pro license to use the plugin feature.
For UnitySendMessage and Unity plugin, visit Unity Doc-Building Plugins for iOS. You can find an example in the doc called Bonjour Browser Sample. It is a very good starting point for you. If you have 1 year experience with Xcode, I think it will be easy for you.
For use delegate and event in Unity, visit Prime31's Unity Tip video.

Check out Niklas's free unity iOS plugin.
http://forum.unity3d.com/threads/122681-Free-facebook-Plugin-for-Unity-iOS
It doesn't work out of the box anymore, but with a few changes and updates you can get it working.
If you already have xCode experience then hopefully the extra work should be trivial since the Facebook SDK docs are pretty good.

Related

Augmented Reality Desktop Application using Unity

Can we create an augmented reality desktop application using unity which can convert all images from a school textbook into 3D objects. ? If yes, then what will be the procedure and what other tools do we need. ? It is our final year project and we really need help in this.
If watermark will not be an issue than you can use Vuforia library.
https://developer.vuforia.com/
It has nice unity integration and you can archive what you are up to in almost no time :). But it is not supporting desktop build out of the box, but below you have alternative libraries that do:
http://artoolkit.org/download-artoolkit-sdk#unity
http://www.easyar.com/view/download.html
I can't say how good they are because I have never used them.
You can try artoolkit, stable and simple. Easyar is good but a little young.
I recommend using ARToolKit. You can target OSX, Windows and Linux if you need to. Also using the Unity plugin it should be easy for you to get started.
And if you decide to go on mobile later it also has support for iOS and Android.
http://artoolkit.org/download-artoolkit-sdk
(Scroll down for Unity version)
Edit:
They also have an active forum where you can ask questions and find help if you have the need:
http://artoolkit.org/community/forums/
Best

how to upload video using Facebook sdk 7.3 in unity?

I've tried building apps with Xcode and it has been a struggle, i then discovered unity and an entire world opened up to me. and then i released 3 games this year on the iOS apple store made in unity.
now I'm trying to build a game and this games main feature is to upload and view videos. let me call it what it is making an app with unity. why? because i know how to use unity, this is my tool.
so i headed to Facebook and download the latest SDK for unity and boy did it take me time to figure how it works. after weeks of struggle i found out that the Facebook SDK can not upload video, well at least not yet (i hope i can ask them if they could make it that the Facebook unity SDK can do everything that all the other sdk's can do, like their iOS sdk and android sdk).
the way i found out was when i submitted a bug report and asked a Facebook team member and they told me that it is not supported. i then went to check the references of the Facebook iOS sdk and compared it to the reference of the Facebook unity SDK and to my wonder the calls are not there.
so my question is how can i use Facebook sdk in unity the way that i want it to?
is there a method of using the Facebook iOS SDK in unity and not the Facebook unity SDK?
At the end of the day i would really like to push the app out on android as well hence why i added the android tag. so I'm sure if i can achieve it with either platform i can just do it for the other one as well.
please if anyone can share assistance it would be appreciated, I'm extremely serious to get this project completed i can't wait to share my idea with the world.
seems like I've confused myself. apparently one can do exactly what i want to do. The Facebook team member responded to my question I've included his exact reply for your convenience.

Game development using Unity for iPhone

I have decided to use the game engine Unity to develop my game for iPhone. But I need to use some functions built into the iOS SDK.
If I choose to develop using Unity, can I still use functions from the standard iOS SDK? Like functions to access a url, etc...
When you compile a Unity project for iOS it takes your C# or JavaScript code and AOT compiles it to a native dll. It then creates an xcode project which loads that dll. You can add native objectiveC, or C/C++ functions to this project and expose them for calling from the Unity engine.
http://unity3d.com/support/documentation/Manual/Plugins.html
Unity also has built-in methods for accessing URLs.
I don't know how the Unity SDK is built, but if it's a static Objective-C library then you can access iOS SDK functions without any problems. If its a script engine where you develop your scripts outside the IDE then you may not access iOS function.
Have you checked other engines/sdk's for your game development? I know that Cocos2D is well documented and I know for sure that you can call iOS methods.
Good luck!
I used both unity3d and corona which are very good at their field, and yes you can use all standart SDK over them, sometimes you need to do tricks though (which is quite a pain). If you are developing a 3d game and familiar with NVIDIA PhysX engine go for unity, it gives you nice features. But if you are clueless about collasions/rigidbodies/ragdolls etc you would have a hard time for sure.
As for 2d application development since I don't like Objective-C I prefer corona which you code in lua (easy to learn and use). You can use most of the IOS SDK in it without any problem.
I really reccomend you starting with Unity, it is the best engine I have ever used (I have used a ton of bad engines).
Unity is the best place to start and to stay. Coding, graphics and everything is simple to manage in this engine.
Unity is specially 3d but you can also build 2d games, some examples are Zombieville and OMG Pirates (very succesfull games on the appstore).

Mixing Unity generated code with Objective-C in iOS?

Is it possible to mix iOS code and interface elements with Unity generated iOS code?
For example if I am working with a game developer who is developing a game in Unity, could I take his xCode project (generated by Unity), and add interface elements which I code myself using Objective-C & Interface Builder etc?
From what I can see this isn't possible as everything is created via Unity.... but hopefully I am wrong...
Thanks!
You can even use 3rd party libraries in XCode and integrate them in the build process. After fiddling around with the right settings I wrote a blog entry about this:
iPhone & Unity3D: Integrating 3rd Party Static Libraries in Unity3D Generated XCode Projects
You should be able to generate Native plug ins to interact with the Unity code. You would need to write a wrapper though. Read more at: http://unity3d.com/support/documentation/Manual/Plugins.html
Read the part at iOS :)
I came across this general guide to working with Unity native plugins in OSX which was useful and is probably where you need to be looking for your answer, as Zophiel said
https://blog.reigndesign.com/blog/unity-native-plugins-os-x
You can just design a view and button to trigger the unity to run or stop, but models in unity can't be controlled using Obj-C, although unity has import to Xcode, it only import the start code, game scripts depending on the link libraries which couldn't be modified.
I think you can do it as the same way I probably has been working with Objective-C without any changes. For Unity's code generator preserves the native codes under Classes.
And furthermore there is an another way to do this which is called "Plug-in".
But I hope the developers in Unity find a better way seamlessly combined with Xcode as staffs in Apple usually does.
Combining IB and Unity's integrated editor would be better and more welcomed in future.
Possible yes. Advisable for beginner or intermediate level Devs? Probably not. The Unity project is generated and regenerated every time you push a build. Now I believe that if you use Append when you do builds that it should keep existing changes to the Xcode project... but 'should' is the operative word there. You may need to implement some sort of build system like Jeeves to keep the headaches to a minimum if you are trying to do this on a large project in which you for see a constant stream of updates from both the Unity side and the Xcode side.
Now if you're integrating code that is in it's own files and doesn't overlap or rewrite the code Unity has generated, then the Append feature is really going to work for you, but if you're deleting, altering, or adding code to any of the files that Unity generated then definitely use SVN or some other form of source control and snap shot before and after every new Unity recompile / Xcode generation.
Also, take a look in the Unity Asset store. Whatever functionality you are trying to home brew in Xcode can definitely be written in C# on Unity. Someone else may have already conquered the problem you're trying to solve and placed it in the asset store for $5.
Hope that helps.

Game development on iPhone using Unity engine

Im very new to game development on the iPhone... And I have a question:
If I was to unity, how would that work... Would I use objective-c in unity? or is all of it like just click it, and add properties, no code (that may be a stupid question, but im just wondering)
And once your done with the unity app, does it automaticly complile an xcode file for you?
Im just wondering... Thanks
Unity provides it's own visual design environment, and scripting language support. The scripting is done with C#, Javascript, and Boo for all the platforms they support. You can test your apps on the iPhone.
You can download the trial on their website.
I have used Unity and worked with some of their people, here is what I can offer:
Unity is a visual editor and as mentioned by ManiacDev you can use C#, Javascript, and Boo.
You can do a lot without coding a line and it outputs a file for you to compile in xcode. That's pretty sweet. It is very much WYSIWYG - but for some that leaves a lot to be desired.
Examining this further:
If you did want to use your own Objective C classes and code and bring them into Unity this would require purchasing their Pro version. Personally - I wouldn't go the basic license for this one reason alone. If I want to use my own server or anything else I have already coded in other projects of course I would want to take advantage of the work I have already created and not rewrite more code in C# - for the iPhone this makes no sense at all considering the uniqueness of the device and the other possibilities that could be imagined when having full access to the SDK.
The other thing you might want to think about is that their logo will appear with the basic version - if you don't care and you want to use their tools - the basic version is a great entry point. I personally do not mind their logo at all but again not having the full SDK at my disposal is not a place I would like to be locked in when you want to see your full creative potential.
Hope this helps,
Matthew