디자인 변경 중
This commit is contained in:
43
Assets/Scripts/UVC/UI/Commands/MinimizeApplicationCommand.cs
Normal file
43
Assets/Scripts/UVC/UI/Commands/MinimizeApplicationCommand.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
#nullable enable
|
||||
using UnityEngine;
|
||||
#if UNITY_STANDALONE_WIN
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
#endif
|
||||
|
||||
namespace UVC.UI.Commands
|
||||
{
|
||||
public class MinimizeApplicationCommand : ICommand
|
||||
{
|
||||
|
||||
#if UNITY_STANDALONE_WIN
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool ShowWindow(IntPtr hwnd, int nCmdShow);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr GetActiveWindow();
|
||||
|
||||
private const int SW_MINIMIZE = 6;
|
||||
#endif
|
||||
|
||||
public void Execute(object? parameter = null)
|
||||
{
|
||||
// 파라미터는 여기서는 사용되지 않을 수 있음
|
||||
if (parameter != null)
|
||||
{
|
||||
Debug.Log($"MinimizeApplicationCommand 실행됨 (파라미터 무시됨: {parameter})");
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("MinimizeApplicationCommand 실행됨");
|
||||
}
|
||||
|
||||
#if UNITY_STANDALONE_WIN
|
||||
ShowWindow(GetActiveWindow(), SW_MINIMIZE);
|
||||
#else
|
||||
Debug.Log("창 최소화는 Windows 독립 실행형에서만 지원됩니다.");
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: def4dca38129c4d4fb17f819b3e799bf
|
||||
@@ -0,0 +1,13 @@
|
||||
using UVC.UI.Commands;
|
||||
using UVC.UI.Commands.Mono;
|
||||
|
||||
namespace Assets.Scripts.UVC.UI.Commands.Mono
|
||||
{
|
||||
internal class MinimizeApplicationCommandMono : MonoBehaviourCommand
|
||||
{
|
||||
public override void Execute()
|
||||
{
|
||||
new MinimizeApplicationCommand().Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f3c6fc4cbf58b35409c0bbd44175ecec
|
||||
Reference in New Issue
Block a user