Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var button_X:float;
- var button_Y:float;
- var button_W:float;
- var button_H:float;
- function Start()
- {
- button_X = Screen.width * 0.05;
- button_Y = Screen.width * 0.05;
- button_W = Screen.width * 0.1;
- button_H = Screen.width * 0.1;
- }
- function startserver()
- {
- Network.InitializeServer(32, 25000, !Network.HavePublicAddress);
- }
- //Messages
- function OnServerInitialized()
- {
- Debug.Log("Server Initialized");
- }
- function OnGUI()
- {
- if(GUI.Button(Rect(button_X, button_Y, button_W, button_H), "Start Server"))
- {
- Debug.Log("Starting Server");
- startserver();
- }
- if(GUI.Button(Rect(button_X, button_Y * 1.2 + button_H, button_W, button_H), "Refreash Host"))
- {
- Debug.Log("Refreashing");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement