示例#1
0
    public void OnSaveButtonClick()
    {
        //Get stickers from the contentScroll
        Sticker[] stickers = new Sticker[contentScroll.GetContentComponents().Length];
        for (int i = 0; i < contentScroll.GetContentComponents().Length; i++)
        {
            Sticker sticker = contentScroll.GetContentComponents()[i].GetComponent <QROption>().GetSticker();
            if (sticker != null)
            {
                stickers[i] = sticker;
            }
        }

        //Add stickers to JSON file
        StickerData stickerData = new StickerData();

        foreach (Sticker sticker in stickers)
        {
            stickerData.AddSticker(sticker);
        }

        savedPopup.DisplayPopup(3);
        LoadStickersFromFile();
        OnDetailsChanged();
    }
示例#2
0
    void Update()
    {
        currentDateTime.text = System.DateTime.Now.ToString("dd MMM yyyy hh:mm tt");

        //Edit camera raw data to rotate correctly
        //transform.rotation = baseRotation * Quaternion.AngleAxis(camTexture.videoRotationAngle, Vector3.up);

        if (scanReady)
        {
            scanTimer -= Time.deltaTime;

            IBarcodeReader barcodeReader = new BarcodeReader();
            //decode the current frame
            if (camTexture.isPlaying)
            {
                Result result = barcodeReader.Decode(camTexture.GetPixels32(), camTexture.width, camTexture.height);

                if (result != null)
                {
                    QRCodeScanned(result);
                }
            }

            if (scanTimer <= 0f)
            {
                scanReady = false;
                scanError.DisplayPopup(4);
            }
        }
    }