// Start is called before the first frame update void Start() { playerState.playerRole = "Receiver"; Debug.Log("Connecting to web socket"); if (!NetworkMessaging.socketOpen()) { NetworkMessaging.ConnectWebSocketToServerAsync("ws://localhost:8095/connectdemo"); } }
// Start is called before the first frame update void Start() { playerState.playerRole = "Sender"; step_dropdown = GameObject.Find("step_dropdown").GetComponent <Dropdown>(); verb_dropdown = GameObject.Find("verb_dropdown").GetComponent <Dropdown>(); noun_dropdown = GameObject.Find("noun_dropdown").GetComponent <Dropdown>(); answer.verbs = new string[] { "Push", "Turn", "Turn", "Cut" }; answer.nouns = new string[] { "Wire", "Dial", "Switch", "Switch" }; cypher.verbs = new string[] { "Push", "", "Turn", "" }; cypher.nouns = new string[] { "", "Dial", "", "Switch" }; Debug.Log("Connecting to web socket"); if (!NetworkMessaging.socketOpen()) { NetworkMessaging.ConnectWebSocketToServerAsync("ws://localhost:8095/connectdemo"); } }
// Start is called before the first frame update void Start() { var playerRequest = new newPlayerRequest(); string response = ""; playerRequest.playerName = SystemInfo.deviceUniqueIdentifier; playerRequest.deviceID = SystemInfo.deviceUniqueIdentifier; try { Debug.Log("Sending new player"); response = NetworkMessaging.SendJsonViaPOST(playerRequest, "http://35.209.52.72:80/newPlayer").ToString(); } catch (SystemException e) { Debug.Log("error was: " + e); } playerState.playerId = response; Debug.Log("Connecting to web socket"); NetworkMessaging.ConnectWebSocketToServerAsync("ws://localhost:8095/connect"); }