void spawnCar(int id)
    {
        Lobby.SetActive(false);
        inLobby = false;
        inTrackSelect = false;
        inGame = true;

        MultiplayerLobbyManager comp = this.GetComponent<MultiplayerLobbyManager>();
        comp.CmdgoReady();

        var track = comp.trackPrefabs[trackID];
        var startPos = track.startPos[spawnID];
        var startRot = track.startRot;

        var car = (GameObject)Instantiate(carPrefab, startPos, Quaternion.Euler(startRot.x, startRot.y, startRot.z), this.transform);
        NetworkServer.Spawn(car);
    }
Ejemplo n.º 2
0
 void Start()
 {
     Instance = this;
 }