menu 개발 중. 언어 변경 시 반영 않됨
This commit is contained in:
7
Assets/Scripts/UVC/UI/Commands/ICommand.cs
Normal file
7
Assets/Scripts/UVC/UI/Commands/ICommand.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace UVC.UI.Commands
|
||||
{
|
||||
public interface ICommand
|
||||
{
|
||||
void Execute();
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UVC/UI/Commands/ICommand.cs.meta
Normal file
2
Assets/Scripts/UVC/UI/Commands/ICommand.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f0eef464dda89d4b9f20e533843b83f
|
||||
62
Assets/Scripts/UVC/UI/Commands/MenuCommands.cs
Normal file
62
Assets/Scripts/UVC/UI/Commands/MenuCommands.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UVC.Locale;
|
||||
using UVC.Log;
|
||||
|
||||
namespace UVC.UI.Commands
|
||||
{
|
||||
// 간단한 디버그 로그 출력 커맨드
|
||||
public class DebugLogCommand : ICommand
|
||||
{
|
||||
private readonly string _message;
|
||||
|
||||
public DebugLogCommand(string message)
|
||||
{
|
||||
_message = message;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
ULog.Debug(_message);
|
||||
}
|
||||
}
|
||||
|
||||
// 애플리케이션 종료 커맨드
|
||||
public class QuitApplicationCommand : ICommand
|
||||
{
|
||||
public void Execute()
|
||||
{
|
||||
ULog.Debug("애플리케이션을 종료합니다.");
|
||||
Application.Quit();
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorApplication.isPlaying = false; // 에디터에서 실행 중일 경우 플레이 모드 종료
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// 언어 변경 커맨드
|
||||
public class ChangeLanguageCommand : ICommand
|
||||
{
|
||||
private readonly string _languageCode;
|
||||
private readonly LocalizationManager _localizationManager;
|
||||
|
||||
public ChangeLanguageCommand(string languageCode, LocalizationManager localizationManager)
|
||||
{
|
||||
_languageCode = languageCode;
|
||||
_localizationManager = localizationManager;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
if (_localizationManager != null)
|
||||
{
|
||||
_localizationManager.SetCurrentLanguage(_languageCode);
|
||||
ULog.Debug($"언어가 {_languageCode}(으)로 변경되었습니다. (Command)");
|
||||
}
|
||||
else
|
||||
{
|
||||
ULog.Error("LocalizationManager가 ChangeLanguageCommand에 전달되지 않았습니다.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/UVC/UI/Commands/MenuCommands.cs.meta
Normal file
2
Assets/Scripts/UVC/UI/Commands/MenuCommands.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c05439dd4537f6245a5cb70f56d372c7
|
||||
Reference in New Issue
Block a user