Skip to content

Instantly share code, notes, and snippets.

@olokobayusuf

olokobayusuf/PhotoCam.cs Secret

Last active Apr 9, 2018
Embed
What would you like to do?
using UnityEngine;
using NatCamU.Core;
public class PhotoCam : NatCamBehaviour {
// Update is called once per frame
void Update () {
foreach (var touch in Input.touches)
if (touch.tapCount == 2)
NatCam.CapturePhoto (OnPhoto);
}
void OnPhoto (Texture2D photo) {
// Display it on our RawImage
preview.texture = photo;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.