Exemplo n.º 1
0
        public void TestButtonEnableStateChanges()
        {
            IDisposable joiningRoomOperation = null;

            assertButtonEnableState(true);

            AddStep("begin joining room", () => joiningRoomOperation = OngoingOperationTracker.BeginOperation());
            assertButtonEnableState(false);

            AddStep("end joining room", () => joiningRoomOperation.Dispose());
            assertButtonEnableState(true);

            AddStep("disconnect client", () => MultiplayerClient.Disconnect());
            assertButtonEnableState(false);

            AddStep("re-connect client", () => MultiplayerClient.Connect());
            assertButtonEnableState(true);
        }
Exemplo n.º 2
0
    private void Awake()
    {
        Instance = this;
        Application.targetFrameRate = 60;

        string id = SystemInfo.deviceUniqueIdentifier;

        if (Application.isEditor)
        {
            id = id + "_editor";
        }
        multiplayerClient.Initialize(id);
        Globals.Instance.multiplayerClient.connector.onConnected       = OnConnected;
        Globals.Instance.multiplayerClient.connector.onFailedToConnect = OnFailedToConnect;
        Globals.Instance.multiplayerClient.connector.onDisconnected    = OnDisconnected;

        connectUI.Show();
        connectUI.Processing();
        multiplayerClient.Connect();
    }