示例#1
0
        void GetDevices(string deviceName = null)
        {
            string model = deviceName ?? SystemInfo.deviceModel;

//#if UNITY_EDITOR
//            model = EditorDeviceModel;
//#endif

            devices = deviceList.Platforms.Single(item => item.Platform == platformName).Devices;

            Device device = devices.Find(item => item.Models.Find(modelName => modelName.Equals(model)) != null);

            device = device ?? devices.Find(item => item.BaseModelNames.Find(modelName => modelName.Contains(model)) != null);

            if (device == null)
            {
                ModelNull();
                return;
            }
#if UNITY_ANDROID
            MirageAR_DeviceApi.PutServiceString("SelectModel", "");
#endif


            SetSize(device);
            parent.SetState(MainControl.Transtion.Start);
        }
示例#2
0
        void ModelNull()
        {
            UnityEngine.UI.Text m_Model = tsf.Find("ModelName").GetComponent <UnityEngine.UI.Text>();
            m_Model.text = devices[currentIndex].Name;

            MirageAR_UIEventListener.Get(tsf.Find("Left").gameObject).onClick = () => { currentIndex--; if (currentIndex < 0)
                                                                                        {
                                                                                            currentIndex = devices.Count - 1;
                                                                                        }
                                                                                        m_Model.text = devices[currentIndex].Name; SetSize(devices[currentIndex]); };
            MirageAR_UIEventListener.Get(tsf.Find("Right").gameObject).onClick = () => { currentIndex++; if (currentIndex >= devices.Count)
                                                                                         {
                                                                                             currentIndex = 0;
                                                                                         }
                                                                                         m_Model.text = devices[currentIndex].Name; SetSize(devices[currentIndex]); };
            MirageAR_UIEventListener.Get(tsf.Find("Button").gameObject).onClick = () => {
#if UNITY_ANDROID && !UNITY_EDITOR
                MirageAR_DeviceApi.PutServiceString("SelectModel", devices[currentIndex].SettingsFile);
#endif
                parent.SetState(MainControl.Transtion.Start);
            };
        }