Files
UmaViewer/Assets/Plugins/UnityGLTF/Samples~/Sample Scenes/Scripts/WebServerComponent.cs
T
左右看 0d848e4d07 bug fix
2023-06-28 00:35:46 +08:00

23 lines
433 B
C#

using UnityEngine;
namespace UnityGLTF.Examples
{
public class WebServerComponent : MonoBehaviour
{
private SimpleHTTPServer _server;
void Start()
{
var appPath = Application.dataPath;
var wwwPath = appPath.Substring(0, appPath.LastIndexOf("Assets")) + "www";
_server = new SimpleHTTPServer(wwwPath, 8080);
Debug.Log("Starting web server...");
}
private void OnDestroy()
{
_server.Stop();
}
}
}