Skip to content

GimChuang/UnityWebTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnityWebTool

Simple scripts featuring uploading picture to your server and generate QR codes from the pictures' url. There is a Test_WebTool sample scene showing how I use the scripts.

Dependency

This project use LitJson to parse Json files and ZXing to generate QR codes.

Scripting Reference

WebTool.cs

UploadPhoto(Texture2D _textureToUpload, string _fileName)

uploads _textureToUpload as a png with _fileName as its filename. Internally this function uses UnityWebRequest to upload the picture to urlForUploading with bodyKey and mimeType. If the uploading is successful, it parses downloaded json string to get the picture's url for QRCodeGenerator.cs to generate a QR code. Note that it's for my use case and it may not fit your need ;-)

OnUploadPhotoReqFinish(bool success, string photoUrl)

is called when the WebRequest finishes.

QRCodeGenerator.cs

GenerateQRCode(string _textToEncode)

encodes _textToEncode to a Texture2D.

OnQRCodeGenerated(Texture2D _texture)

is called when the QR code is generated.

Note

This project use Git submodule gm_WebcamTool. You need to call

git clone --recurse-submodules <URL>

when you clone this reposiory.

About

Simple scripts to upload pictures to your server and generate QR codes from the pictures' URL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages