コード例 #1
0
    public void OnUserRequestFindGame(string nickname, Garage.Vehicle vehicle)
    {
        if (DEBUG)
        {
            Debug.Log("OnUserRequestFindGame");
        }

        Debug.Log(string.Format("user requested nickname: {0} and vehicle id: {1}", nickname, vehicle.Id));
        ClientNickName  = nickname;
        ClientVehicleId = vehicle.Id;
        _innerProcess.MoveNext(Command.JoinGame);
        ensureCorrectScene();

        if (Flags.GAME_SERVER_IS_LOCALHOST)
        {
            OnServerDiscovered(":ffff::localhost");
        }
        else
        {
            // begin listening
            _discoveryClient = transform.gameObject.AddComponent <DiscoveryClient> ();
            _discoveryClient.serverDiscoveryEvent += OnServerDiscovered;
            _discoveryClient.ListenForServers();
        }
    }
コード例 #2
0
    private void MoveToConnecting()
    {
        _currentStage = Stage.Connecting;
        NextStageButton.gameObject.SetActive(false);
        _chosenVehicle = CarPickerObj.CurrentVehicle();
        VehicleSelectionStageObj.SetActive(false);
        ConnectingStageObj.SetActive(true);
        ConnectingTextObject.StartBlinking();

        ClientSceneManager.Instance.OnUserRequestFindGame(_chosenNickname, _chosenVehicle);
    }