All Projects → nenuadrian → qr-code-unity-3d-read-generate

nenuadrian / qr-code-unity-3d-read-generate

Licence: other
Generating a QR code / Scanning a QR code in Unity 3D. Pre-build DLL and sample code from old Unity

Projects that are alternatives of or similar to qr-code-unity-3d-read-generate

Unity Assetpipeline Presentation
Unity project for "A Technical Deep-Dive into Unity's Asset Pipeline" presented at Develop: 2018
Stars: ✭ 31 (-55.71%)
Mutual labels:  unity-scripts, unity-3d, unity2d
Swiftscan
A barcode and qr code scanner( 二维码/条形码扫描、生成,仿微信、支付宝)
Stars: ✭ 293 (+318.57%)
Mutual labels:  qrcode, qrcode-scanner, qrcode-generator
Unitylibrary
📚 Library of all kind of scripts, snippets & shaders for Unity
Stars: ✭ 1,968 (+2711.43%)
Mutual labels:  unity-scripts, unity-3d, unity2d
UnityDebug
A wrapper script for Unity debug calls to use conditional attributes in order to avoid debug code being compiled into release builds.
Stars: ✭ 29 (-58.57%)
Mutual labels:  unity-scripts, unity-3d, unity2d
UnityHexagonLibrary2d
A library to manage 2D hexagonal tiles in Unity.
Stars: ✭ 58 (-17.14%)
Mutual labels:  unity-scripts, unity-3d, unity2d
Savegamepro
A Complete and Powerful Save Game Solution for Unity (Game Engine)
Stars: ✭ 30 (-57.14%)
Mutual labels:  unity-scripts, unity-3d, unity2d
QR Attendance
This project is an attendance system which provides attendance on scanning QR code. The attendance is stored in Excel sheet named with the date of attendance taken. In this folder a file named Generate.py is used to generate the QR code for given input file. Attend.py file is for scanning the QR code
Stars: ✭ 17 (-75.71%)
Mutual labels:  qrcode, qrcode-scanner, qrcode-generator
unity-dijkstras-pathfinding
Dijkstra's Pathfinding Algorithm Unity Implementation. (Not being maintained by me, it is just an experiment.)
Stars: ✭ 80 (+14.29%)
Mutual labels:  unity-scripts, unity-3d, unity2d
Qrcode
A pure JavaScript QRCode encode and decode library.
Stars: ✭ 69 (-1.43%)
Mutual labels:  qrcode, qrcode-scanner, qrcode-generator
Czxing
C++ port of ZXing and ZBar for Android.
Stars: ✭ 854 (+1120%)
Mutual labels:  qrcode, qrcode-scanner, qrcode-generator
Apple Signin Unity
Unity plugin to support Sign In With Apple Id
Stars: ✭ 228 (+225.71%)
Mutual labels:  unity-scripts, unity-3d, unity2d
BGAQRCode-Android
QRCode 扫描二维码、扫描条形码、相册获取图片后识别、生成带 Logo 二维码、支持微博微信 QQ 二维码扫描样式
Stars: ✭ 7,714 (+10920%)
Mutual labels:  qrcode, qrcode-scanner, qrcode-generator
Efqrcode
A better way to operate QR Code in Swift, support iOS, macOS, watchOS and tvOS.
Stars: ✭ 4,121 (+5787.14%)
Mutual labels:  qrcode, qrcode-scanner, qrcode-generator
flutter qr code scanner generator sharing
Flutter App For Scanning, Generating, Sharing QR Code
Stars: ✭ 137 (+95.71%)
Mutual labels:  qrcode, qrcode-scanner, qrcode-generator
qrrs
CLI QR code generator and reader written in rust
Stars: ✭ 29 (-58.57%)
Mutual labels:  qrcode, qrcode-scanner, qrcode-generator
TsukiSuite
A toolsuite created to make Unity development easier
Stars: ✭ 23 (-67.14%)
Mutual labels:  unity-3d, unity2d
qrencode-el
QRCode encoder for Emacs in pure elisp
Stars: ✭ 18 (-74.29%)
Mutual labels:  qrcode, qrcode-generator
qrcodescan.in
📠 A simple, fast, and useful progressive web application.
Stars: ✭ 144 (+105.71%)
Mutual labels:  qrcode, qrcode-scanner
JsonFormatter
Easy, Fast and Lightweight Json Formatter. (Serializer and Deserializer)
Stars: ✭ 26 (-62.86%)
Mutual labels:  unity-scripts, unity-3d
SkiaSharp.QrCode
Qr Code Generator with Skia. (no System.Drawing)
Stars: ✭ 72 (+2.86%)
Mutual labels:  qrcode, qrcode-generator

qr-code-unity-3d-read-generate

Generating a QR code / Scanning a QR code in Unity 3D

At least at the time when I needed this feature, there were barely any usable tutorials or QR libraries ready to use for Unity (given the older .net framework it uses).

Took me a few days of trial and error until finding and properly building the ZXing library DLL which you can find in the repo.

Read a QR

using ZXing;
using ZXing.QrCode;

private WebCamTexture camTexture;
private Rect screenRect;
void Start() {
  screenRect = new Rect(0, 0, Screen.width, Screen.height);
  camTexture = new WebCamTexture();
  camTexture.requestedHeight = Screen.height;
  camTexture.requestedWidth = Screen.width;
  if (camTexture != null) {
    camTexture.Play();
  }
}

void OnGUI () {
  // drawing the camera on screen
  GUI.DrawTexture (screenRect, camTexture, ScaleMode.ScaleToFit);
  // do the reading — you might want to attempt to read less often than you draw on the screen for performance sake
  try {
    IBarcodeReader barcodeReader = new BarcodeReader ();
    // decode the current frame
    var result = barcodeReader.Decode(camTexture.GetPixels32(), camTexture.width , camTexture.height);
    if (result != null) {
      Debug.Log(“DECODED TEXT FROM QR: “ + result.Text);
    }
  } catch(Exception ex) { Debug.LogWarning (ex.Message); }
}

Generate one

private static Color32[] Encode(string textForEncoding, int width, int height) {
  var writer = new BarcodeWriter {
    Format = BarcodeFormat.QR_CODE,
    Options = new QrCodeEncodingOptions {
      Height = height,
      Width = width
    }
  };
  return writer.Write(textForEncoding);
}

public Texture2D generateQR(string text) {
  var encoded = new Texture2D (256, 256);
  var color32 = Encode(text, encoded.width, encoded.height);
  encoded.SetPixels32(color32);
  encoded.Apply();
  return encoded;
}

Texture2D myQR = generateQR("test");
if (GUI.Button (new Rect (300, 300, 256, 256), myQR, GUIStyle.none)) {}

I am using Unity 5.3.5

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].