Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- /// <summary>
- /// 二重起動を防止する
- /// </summary>
- public class AvoidDoubleLaunch : MonoBehaviour
- {
- void Start()
- {
- string processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
- if (System.Diagnostics.Process.GetProcessesByName(processName).GetUpperBound(0) > 0)
- {
- Debug.Log("同じアプリがすでに起動しています.");
- Application.Quit();
- }
- }
- }
Add Comment
Please, Sign In to add comment