Exemple #1
0
 public void OnUpdatedNetworkState(ENetworkState newNetworkState, AbstractBEventDispatcher bEventDispatcher)
 {
     if (ARE_EQUAL(BEventDispatcher, bEventDispatcher))
     {
         NetworkState = newNetworkState;
         BEventsCollection.NETWORK_NetworkStateUpdated.Invoke(new BEHandle <ENetworkState>(NetworkState));
     }
 }
Exemple #2
0
        private void RemoveBEventDispatcher(AbstractBEventDispatcher bEventDispatcher)
        {
            switch (bEventDispatcher.GetBEventDispatcherType())
            {
            case BEventDispatcherType.MIRROR:
                NetworkManager mirrorNetworkManager = FindObjectOfType <NetworkManager>();
                if (mirrorNetworkManager != null)
                {
                    Destroy(mirrorNetworkManager.gameObject);
                }
                break;
            }

            // Destroy Dispatcher Component
            Destroy(bEventDispatcher);
        }
Exemple #3
0
        public void SetBEventDispatcher(BEventDispatcherType bEventDispatcherMode)
        {
            // Disconnect
            if (NetworkState != ENetworkState.NOT_CONNECTED)
            {
                Disconnect();
            }

            // Remove existing Dispatcher
            AbstractBEventDispatcher bEventDispatcher = FindObjectOfType <AbstractBEventDispatcher>();

            if (bEventDispatcher)
            {
                RemoveBEventDispatcher(bEventDispatcher);
            }

            // Add new Dispatcher
            if (AddBeventDispatcher(bEventDispatcherMode))
            {
                BEventsCollection.NETWORK_NewBEventDispatcherSet.Invoke(new BEHandle <AbstractBEventDispatcher>(BEventDispatcher));
            }
        }