コード例 #1
0
        void Update()
        {
            if (null == m_button)
            {
                return;
            }

            // update button text and interactable state

            if (NetBroadcast.IsListening())
            {
                string buttonText = m_originalButtonText;
                int    numDots    = (int)Time.time % 3 + 1;
                for (int i = 0; i < numDots; i++)
                {
                    buttonText += ".";
                }

                if (m_buttonTextComponent)
                {
                    m_buttonTextComponent.text = buttonText;
                }

                m_button.interactable = false;
            }
            else
            {
                if (m_buttonTextComponent)
                {
                    m_buttonTextComponent.text = m_originalButtonText;
                }

                m_button.interactable = true;
            }
        }
コード例 #2
0
 private void DelayedStop()
 {
     if (NetBroadcast.IsListening())
     {
         NetBroadcast.StopBroadcastingAndListening();
     }
 }
コード例 #3
0
ファイル: NetBroadcast.cs プロジェクト: b2220333/uGameCore
        void Awake()
        {
            if (singleton != null)
            {
                return;
            }

            singleton = this;

//			// create custom network discovery
//			m_customNetworkDiscovery = new GameObject ("NetworkDiscovery").AddComponent<CustomNetworkDiscovery> ();
//			DontDestroyOnLoad (m_customNetworkDiscovery.gameObject);
//			// register to event
//			m_customNetworkDiscovery.onReceivedBroadcast += (string arg1, string arg2) => { OnReceivedBroadcastFromCustomNetworkDiscovery(arg1, arg2); };
        }
コード例 #4
0
        void OnClicked()
        {
            // clear the table, and start listening if not already started

            NetBroadcast.allReceivedBroadcastData.Clear();

            if (this.table)
            {
                this.table.Clear();
                this.table.UpdateTable();
            }

            if (!NetBroadcast.IsListening())
            {
                NetBroadcast.StartListening();
                LANScan2UI.StopListeningLater();
            }
        }
コード例 #5
0
 void OnTabSwitched()
 {
     if (this.tabView.ActiveTab && this.tabView.ActiveTab.tabButtonText == this.tabName)
     {
         // our tab was opened
         if (!NetBroadcast.IsListening())
         {
             // clear table
             if (this.table)
             {
                 this.table.Clear();
                 this.table.UpdateTable();
                 UpdateTableLater(this.table);
             }
             // start listening
             NetBroadcast.StartListening();
             // stop after some time
             StopListeningLater();
         }
     }
 }