Exemple #1
0
 protected void OnJoinChannel(int channelID, bool success, string message)
 {
     if (!TNManager.IsHosting(channelID))
     {
         return;
     }
     if (prefab == null)
     {
         Debug.LogErrorFormat("No prefab assigned for {0}", gameObject.name);
         return;
     }
     Spawn(channelID);
 }
Exemple #2
0
    void OnNetworkJoinChannel(int channelID, bool result, string message)
    {
        if (result)
        {
            var p = TNManager.playerData;
            p.SetChild(NODE_TeamId, -1);
            p.SetChild(NODE_Kills, 0);
            p.SetChild(NODE_Deaths, 0);
            //TNManager.SyncPlayerData(); // no longer needed?

            Debug.Log(string.Format("{0} datanode teamid set to {1}", p.name, p.GetChild <int>(NODE_TeamId)));
            OpenLobbyPanel();
            MenuPanel.gameObject.SetActive(false);
            if (TNManager.IsHosting(channelID))
            {
                // update the channel data
                TNManager.channelData = string.Format("{0}'s Game", TNManager.playerName);
            }
        }
        else
        {
            networkMessages.text = "Failed to join: " + message;
        }
    }