示例#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>();
        }