Advertisement
irishstorm

Multiplayer

Dec 24th, 2011
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. var button_X:float;
  2. var button_Y:float;
  3. var button_W:float;
  4. var button_H:float;
  5.  
  6. function Start()
  7. {
  8. button_X = Screen.width * 0.05;
  9. button_Y = Screen.width * 0.05;
  10. button_W = Screen.width * 0.1;
  11. button_H = Screen.width * 0.1;
  12.  
  13. }
  14.  
  15. function startserver()
  16. {
  17. Network.InitializeServer(32, 25000, !Network.HavePublicAddress);
  18. }
  19.  
  20. //Messages
  21. function OnServerInitialized()
  22. {
  23. Debug.Log("Server Initialized");
  24. }
  25.  
  26. function OnGUI()
  27. {
  28. if(GUI.Button(Rect(button_X, button_Y, button_W, button_H), "Start Server"))
  29. {
  30. Debug.Log("Starting Server");
  31. startserver();
  32. }
  33.  
  34. if(GUI.Button(Rect(button_X, button_Y * 1.2 + button_H, button_W, button_H), "Refreash Host"))
  35. {
  36. Debug.Log("Refreashing");
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement