Service Application: Taking A Picture Part 3

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.

--

--

--

Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Aimi Digitally Releases How a Realist Hero Rebuilt the Kingdom Season 2 ED Theme “LIGHTS” Today

Aimi

Golf Hunting 3D

Moss Giant Setup and Animation

933 ETH Bottom

US: Increase in Chilean cherry imports expected this season

Getting stuck in thinking traps? Here’s the shift!

Why Do You Have To Have A Good Water Purifier For Your Home

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Simon Leen

Simon Leen

Developer

More from Medium

2D Mobile: Setting Up The Player

VFX — Adding player thrusters and visual player damage

Tips: ScriptableObject

Creating A Retro Game Over Behavior