using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace CustomUIView { public class BoxUserSettings : MonoBehaviour { [SerializeField] Transform boxSelectDevices; [SerializeField] GameObject[] boxDevices; readonly string[] SelectDevicesStrs = { "ARTEMIS Pro", "Pistol M9", "HOUYI Pro" }; int selectDevicesIndex = 0; // 用于保存当前选择的设备索引 // Start is called before the first frame update void Start() { for (int i = 0; i < boxDevices.Length; i++) { Text text = boxDevices[i].GetComponentInChildren(); text.text = SelectDevicesStrs[i]; Button button = boxDevices[i].GetComponent