Esempio n. 1
0
    public void OnJoinedRoom()
    {
        Room currentRoom = PhotonNetwork.room;

        string mapName = currentRoom.GetMap();

        m_roomMap = m_mapDatabase.GetMapWithMapName(mapName);

        int gamemodeIndex = currentRoom.GetGamemode();

        m_currenGameMode = (Mode)gamemodeIndex;

        Debug.Log("Gamemode : " + m_currenGameMode);

        //Instantiate MasterCLients Player
        if (PhotonNetwork.isMasterClient)
        {
            Gamemode.AddPlayerToTeam(m_currenGameMode, PhotonNetwork.masterClient);
            NetworkEventHandler.SyncSpawnNode(PhotonNetwork.player.GetPlayerTeam(), PhotonNetwork.masterClient);
            m_pingroutine = StartCoroutine(SetPing());
        }

        SetPlayerCount();
        IsRoomFull();
        m_startInternalTimer = true;
    }