Exemplo n.º 1
0
        static void ListRefresh()
        {
            mDeviceInfo = UnityAndroidUSBDebug.getDevices();

            var serial = string.Empty;

            if (null == mContent)
            {
                serial = UnityAndroidUSBDebug.getDeviceSerial();
            }
            else
            {
                serial = mContent[mIndex].text;
            }

            {
                var count = mDeviceInfo.Count;
                mContent = new GUIContent[count];
                for (int index = 0; index < count; ++index)
                {
                    var content = new GUIContent();
                    content.text    = mDeviceInfo[index].mSerial;
                    content.tooltip = mDeviceInfo[index].mDesc;
                    mContent[index] = content;
                }
            }

            selectSerial(serial);
        }
Exemplo n.º 2
0
        void OnGUI()
        {
            if (GUILayout.Button("Refresh"))
            {
                ListRefresh();
            }

            var index = EditorGUILayout.Popup(mIndex, mContent);

            if (index != mIndex)
            {
                UnityAndroidUSBDebug.setDeviceSerial(mContent[index].text);
            }
            mIndex = index;
        }