1
0
mirror of synced 2024-11-27 23:50:50 +01:00
WACVR/Assets/Script/Configuration/StartBatchManager.cs

26 lines
736 B
C#
Raw Permalink Normal View History

using UnityEngine;
using System.Diagnostics;
using System.IO;
using Lavender.Systems;
public class StartBatchManager : MonoBehaviour
{
uint pid = 0;
private void Start()
{
ConfigManager.EnsureInitialization();
if (ConfigManager.config.batFileLocation != "")
pid = StartExternalProcess.Start(ConfigManager.config.batFileLocation);
UnityEngine.Debug.Log("Batch file with PID: " + pid);
//Process.Start(Path.GetFullPath(ConfigManager.config.batFileLocation));
}
private void OnDestroy()
{
if (pid != 0)
{
StartExternalProcess.KillProcess(pid);
UnityEngine.Debug.Log("Batch file with PID: " + pid + " killed");
}
}
}