|
Hi, I have searched all around but I still don't understand how I can create a working native plugin to open and use the photo picker on the iOS. I have also tried the Native Toolkit available from asset store but I still don't know how to do it. I'm not experienced with xcode. I would really appreciate any ready code snippets or steps on how to do it exactly. PS: I do not wish to buy any plugins because I only need this single function. Regards
(comments are locked)
|
|
who successful? given me a sample code ,help!!!
(comments are locked)
|
|
Ok, so I need a system update to look at my old code that did this so I'm going to tell you from memory and you can come back if I missed something. Let me also say this is a good opportunity to create you main menu in Interface Builder as well since you will need a view controller. First, let's give a real brief explanation of some important UI things in Xcode. You have the UIApplication. This is the class that manages all the states in your application. The UIApplicationDelegate Protocol (protocols in Obj-C are similar to interfaces in C#) has a list of messages that will be sent to any class that implements it. The application has all the windows known as UIWindows that are responsible for distributing messages to the various views on the screen. These UIViews are spaces on the screen. If you've ever used Photoshop, the whole piece is like the window and the layers are like UIViews. That example isn't perfect since you can have multiple windows, but it gets the idea across. Now its time for the UIViewController. ViewControllers are managers for views. The control when views appear, how views transition, and manage more complex features. The specific view controller you will need is the UIImagePickerController. It takes your current view controller and hides it while displaying its own on top of it. It's important to note that the Unity app doesn't create a view controller. Everything is done in the Unity Engine. It doesn't change views or have any transitional behavior so it never creates a view controller. What's this mean for us? We have to create a view controller and assign the Unity view to it. So let's go through the steps you will need to take to get here.
I don't know what else you want to do with the image so I can't go to much further than that. That's a basic guide on how to bring the UIImagePickerController into your Unity plugin. I'm pretty sure there are a few mistakes. I haven't done this in a while, and as I said at the top, I can't get into my old files right now. Most of the problems come from the Unity view. the Unity view is a GL view. Simply put, it wants to control the screen. It will sometimes draw itself over other views even if its below them. But I'll try and fix those as you come across them. For now, this should keep you busy for a little while. Thanks Peter. This will surely keep me busy for a while. I'll go through it and try to get it working. I'll come back if I come across some problems. BTW, I'll probably have to study some obj C too; I'm only familiar with c sharp and unity script.
Sep 11 '11 at 08:01 AM
lukas77i
Hello On iOS6, this code dies at this line: self.view = view; Bad access Any idaes?
Oct 04 '12 at 12:48 PM
BTamas
(comments are locked)
|

I can basically tell you everything that you'll need to make it including UI classes and interfacing with Unity as well as a step by step guide, but its quite a bit of work to code it all for you.
Awesome, thanks for the reply. I don't need something very complex but I would massively appreciate if you could take me through how I can get a simple xib screen display in unity and basically just a quick guide on how to get started.
I checked out the unity sample project, but it doesn't explain it at all. I'm just looking for a simple starter that I could extend on.
Thanks