Unity3D2Babylon.ExporterWindow.StartServer C# (CSharp) Method

StartServer() public method

public StartServer ( ) : void
return void
        public void StartServer()
        {
            if (exportationOptions.HostPreviewPage)
            {
                // Validate default project folder selected
                if (String.IsNullOrEmpty(exportationOptions.DefaultProjectFolder))
                {
                    UnityEngine.Debug.LogWarning("No default project file selected. Web server not started.");
                    return;
                }

                // Validate default project folder exists
                if (!Directory.Exists(exportationOptions.DefaultProjectFolder))
                {
                    UnityEngine.Debug.LogWarning("No default project file created. Web server not started.");
                    return;
                }

                bool supported = WebServer.IsSupported;
                string prefix = "http://*:";
                string root = exportationOptions.DefaultProjectFolder;
                int port = exportationOptions.DefaultServerPort;
                bool started = WebServer.Activate(prefix, root, port);
                if (started) UnityEngine.Debug.Log("Babylon.js web server started on port: " + port.ToString());
                if (!started && supported) UnityEngine.Debug.LogWarning("Babylon.js web server is available.");
                if (!started && !supported) UnityEngine.Debug.LogWarning("Babylon.js web server is not available.");
            }
        }