using System.Collections.Generic; using Newtonsoft.Json; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.UIElements; using ZXing; using Button = UnityEngine.UIElements.Button; /* 第一次创建狗的时候选择创建或者是领养 */ public class CreateOrAdopt : MonoBehaviour { private Label messageLabel; private Button createBtn, adoptBtn, cancelBtn; GameObject canvasPlaceholder, initDogCanvas, createAdoptCanvas, cameraContent; private VisualElement backHome; public RawImage cameraTexture; // 摄像头画面显示区域 private WebCamTexture webCamTexture; // 摄像头纹理 private BarcodeReader barcodeReader; // 二维码识别器 private bool isScanning = false; // 是否正在扫描 private float interval = 0.5f; // 扫描间隔 // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { var root = GetComponent().rootVisualElement; messageLabel = root.Q