Service Application: Taking A Picture Part 3

Simon Leen
2 min readOct 25, 2021

Objective: Add the Camera Plugin for Unity

Above we have the TakePhotoPanel. Currently we do not have the abiltiy to take a photo. The process for setting up this feature can be tedious so rather than invent the wheel, we can take advantage of the Unity Asset Store and packages which provide the funtion.

We will use the above package. Unfortunately for Unity 2020 anyway, Unity no longer allows searching the asset store from the editor so go to the Unity Asset Store and search for Native Camera or follow this link. The plugin is free and OpenSource so not only can you use it, you have access to the code to see how it works and if so daring modify. Click the Add to My Assets button and move back to Unity. Open the Package Manager, go to MyAssets, find the package, download and import.

I would like to say plug and play but unfortunately not but there is a handy read me in the plugin folder for both Android and IOS setup with seperate parts on each.

After going through the documentation and example shown on the GitHub page, some small tweaking and removal of some unneeded sections, the code is set.

All that’s left is triggering the TakePhoto method when the TakePhoto button (shown in the first image) is pressed and we have a lovely photo of part of the office curtains taken to show the app is working on mobile. Since the last post the Nav UI button positioning has also been fixed.

--

--