Пример #1
0
        private void Start()
        {
            gameNetPortal = GetComponent <GameNetPortal>();

            gameNetPortal.OnNetworkReadied                      += HandleNetworkReadied;
            gameNetPortal.OnConnectionFinished                  += HandleConnectionFinished;
            gameNetPortal.OnDisconnectReasonReceived            += HandleDisconnectReasonReceived;
            NetworkManager.Singleton.OnClientDisconnectCallback += HandleClientDisconnect;
        }
Пример #2
0
        private void Awake()
        {
            if (instance != null && instance != this)
            {
                Destroy(gameObject);
                return;
            }

            instance = this;
            DontDestroyOnLoad(gameObject);
        }
Пример #3
0
        private void Start()
        {
            gameNetPortal = GetComponent <GameNetPortal>();
            gameNetPortal.OnNetworkReadied += HandleNetworkReadied;

            NetworkManager.Singleton.ConnectionApprovalCallback += ApprovalCheck;
            NetworkManager.Singleton.OnServerStarted            += HandleServerStarted;

            clientData     = new Dictionary <string, PlayerData>();
            clientIdToGuid = new Dictionary <ulong, string>();
            clientSceneMap = new Dictionary <ulong, int>();
        }