Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public override void update()
        {
#if UNITY_ANDROID && !UNITY_EDITOR
            if (MirageAR_DeviceApi.CheckARHeadPermission() == 1)
            {
                // It Will Appear Twice Usb Permission Reqeuest
                //MirageAR_DeviceApi.RequestARHeadPermission();
            }
            else if (MirageAR_DeviceApi.CheckARHeadPermission() == 2)
            {
                if (!Usbflag)
                {
                    Usbflag = true;
                    if (usbState != null)
                    {
                        usbState(usbflag);
                    }
                }
            }
            else
            {
                //if (Usbflag)
                //{
                //    Usbflag = false;
                //    if (usbState != null)
                //    {
                //        usbState(usbflag);
                //    }
                //}
            }
#endif
        }
Exemplo n.º 3
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);
            };
        }