Search Unity

Multiplayer Kit

Discussion in 'Assets and Asset Store' started by DevionGames, Nov 30, 2011.

?

Next Update?

  1. Collision

    50 vote(s)
    11.6%
  2. Day Night Cycle

    72 vote(s)
    16.7%
  3. Save the level , skills and inventory...

    152 vote(s)
    35.3%
  4. Character Customization

    92 vote(s)
    21.3%
  5. Teleportation portals

    13 vote(s)
    3.0%
  6. Basic GM commands

    37 vote(s)
    8.6%
  7. Resolution dependand GUI

    15 vote(s)
    3.5%
  1. inflame

    inflame

    Joined:
    Jul 31, 2014
    Posts:
    24
    Help to make a separate button input and the character to be displayed in 3D


    Code (CSharp):
    1. SelectCharacter();
    2.         }
    3.     }
    4.  
    5.     public void SendSelectedPlayer(string playerName) {
    6.         Room room = smartFox.LastJoinedRoom;
    7.         ISFSObject selectedPlayer= new SFSObject();
    8.         selectedPlayer.PutUtfString("selectedPlayerName", playerName);
    9.         ExtensionRequest request = new ExtensionRequest("selectedPlayer", selectedPlayer, room);
    10.         smartFox.Send(request);
    11.     }
    12.  
    13.     private void SelectCharacter(){
    14.         areaHeight=340;
    15.         int ScreenX = ((int)(Screen.width / 2) - (areaWidth / 2));
    16.         int ScreenY = ((int)(Screen.height / 2) - (areaHeight/ 2));
    17.         GUILayout.BeginArea (new Rect (ScreenX, ScreenY, areaWidth, areaHeight),"Login","Window");
    18.         GUILayout.Space(38);
    19.         pos=GUILayout.BeginScrollView(pos);
    20.         foreach(Player player in characterList){
    21.             if(GUILayout.Button(player.Name)){
    22.                 SendSelectedPlayer(player.Name);
    23.                 UnregisterSFSSceneCallbacks();
    24.                 Application.LoadLevel("game");
    25.             }
    26.         }
    27.         GUILayout.FlexibleSpace();
    28.         GUILayout.EndScrollView();
    29.         if(GUILayout.Button("Create new")){
    30.             CreateCharacter();
    31.         }
    32.         GUILayout.EndArea();
    33.     }
     
    Last edited: Feb 9, 2015
  2. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Please learn how to use code tags:
    http://forum.unity3d.com/threads/using-code-tags-properly.134625/

     
  3. inflame

    inflame

    Joined:
    Jul 31, 2014
    Posts:
    24
    Help to make a separate button input and the character to be displayed in 3D

    Code (CSharp):
    1. SelectCharacter();
    2.         }
    3.     }
    4.     public void SendSelectedPlayer(string playerName) {
    5.         Room room = smartFox.LastJoinedRoom;
    6.         ISFSObject selectedPlayer= new SFSObject();
    7.         selectedPlayer.PutUtfString("selectedPlayerName", playerName);
    8.         ExtensionRequest request = new ExtensionRequest("selectedPlayer", selectedPlayer, room);
    9.         smartFox.Send(request);
    10.     }
    11.     private void SelectCharacter(){
    12.         areaHeight=340;
    13.         int ScreenX = ((int)(Screen.width / 2) - (areaWidth / 2));
    14.         int ScreenY = ((int)(Screen.height / 2) - (areaHeight/ 2));
    15.         GUILayout.BeginArea (new Rect (ScreenX, ScreenY, areaWidth, areaHeight),"Login","Window");
    16.         GUILayout.Space(38);
    17.         pos=GUILayout.BeginScrollView(pos);
    18.         foreach(Player player in characterList){
    19.             if(GUILayout.Button(player.Name)){
    20.                 SendSelectedPlayer(player.Name);
    21.                 UnregisterSFSSceneCallbacks();
    22.                 Application.LoadLevel("game");
    23.             }
    24.         }
    25.         GUILayout.FlexibleSpace();
    26.         GUILayout.EndScrollView();
    27.         if(GUILayout.Button("Create new")){
    28.             CreateCharacter();
    29.         }
    30.         GUILayout.EndArea();
    31.     }
     
  4. stridervan

    stridervan

    Joined:
    Nov 11, 2011
    Posts:
    141
    I hope that anyone who is still interested in project to know that the project is now available as an open source. Please visit the game blog to find out how ....

    http://projectzoso.weebly.com/