Author Topic: Tnet 3.0 create/take channels  (Read 1823 times)

Elmo loves cookies

  • Jr. Member
  • **
  • Thank You
  • -Given: 60
  • -Receive: 1
  • Posts: 62
    • View Profile
Tnet 3.0 create/take channels
« on: May 03, 2016, 10:04:10 AM »
Please help me to create and take channel list from the Server in Tnet 3.0, how its work? :) thanks)

xandeck

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 3
  • Posts: 54
    • View Profile
Re: Tnet 3.0 create/take channels
« Reply #1 on: May 03, 2016, 10:17:34 AM »
I think I can help you with this ;)

  1.  
  2.         /// <summary>
  3.         /// Update channel list (call it on anywhere you want)
  4.         /// </summary>
  5.         public void _RefreshChannels ()
  6.         {
  7.                 TNManager.GetChannelList(_CallOnChannelList);
  8.         }
  9.  
  10.         /// <summary>
  11.         /// Channels list
  12.         /// </summary>
  13.         void _CallOnChannelList (TNet.List<Channel.Info> chList)
  14.         {
  15.                 for (int x = 0; x < chList.size; x++)
  16.                 {
  17.                         //You can get more data besides ID
  18.                         Debug.Log("ID: " + chList[x].id);
  19.                        
  20.                 }
  21.         }
  22.  

Don't forget to add "using TNet;" at the top of your script.
« Last Edit: May 03, 2016, 01:40:02 PM by xandeck »