public void ConnectAs(string name) { if (connection != null) { Destroy(connection); } ServerAddress = serverAddress + "?vsn=" + version + "&duelist=" + name; connection = gameObject.AddComponent <PhoenixWebSocketConnection>(); }
public static void Render(GameObject gameObject, RenderCommand renderCommand) { Package package = (renderCommand as RenderCommand.SendPhoenixPackage).dataPackage; PhoenixWebSocketConnection connection = gameObject.GetComponent <PhoenixWebSocketConnection>(); if (connection == null) { Debug.Log("Tring to send a package on a gameObject without PhoenixWebSocketConnection component"); return; } connection.Send(package); }
public void Disconnect() { Destroy(connection); connection = null; }