H_SafeExperienceDrivingSystem/U3D_DrivingSystem/Assets/Plugin/ProtectProceing/AuthKeep.cs

35 lines
701 B
C#

using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine;
public class AuthKeep : MonoBehaviour
{
void Start()
{
StartCoroutine("ProtectAuth");
}
IEnumerator ProtectAuth()
{
while (true)
{
yield return new WaitForSeconds(30);
var process = Process.GetProcessesByName("LGZNProtect");
if (process.Length < 1)
{
// Application.Quit();
}
}
}
private void OnApplicationQuit()
{
var process = Process.GetProcessesByName("LGZNProtect");
foreach (var pro in process)
pro.Kill();
}
}