Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        protected virtual void Awake()
        {
            m_Go = gameObject;
            //

/*#if UNITY_EDITOR_WIN
 *                      m_Scanner=new BluetoothScanner(this);
 *                      m_BtnStart.onClick.AddListener(()=>{
 *                              m_Scanner.deviceList.Add(new BluetoothScanner.DeviceInfo{name="Virtual Device",address="00:00:00:00:00"});
 *                              OnDeviceListChanged();
 *                      }
 *                      );
 #else*/
            m_Scanner = new BluetoothScanner(this);
            //m_BtnCnnt.onClick.AddListener(OnClick_m_BtnCnnt);
            m_BtnStart.onClick.AddListener(m_Scanner.StartScan);
            m_BtnStop.onClick.AddListener(m_Scanner.StopScan);
//#endif
            //
            if (m_LayoutCnns != null)
            {
                m_UILayout = m_LayoutCnns.GetComponent <UILayout>();
            }
            if (asMain)
            {
                if (main == null)
                {
                    main = this;
                }
                else if (main != this)
                {
                    Log.e("BluetoothScannerGUI", "The main instance exists.");
                }
            }
            if (!showOnAwake)
            {
                m_Go.SetActive(m_IsVisible = false);
            }
            if (debugMode)
            {
                AddRequest(OpenDevice);
            }
        }
 /// <summary>
 ///
 /// </summary>
 public virtual BluetoothConnectButton StartGUI(BluetoothScannerGUI i_scanner)
 {
     scanner = i_scanner;
     Show();
     return(this);
 }