75 lines
2.3 KiB
C#
75 lines
2.3 KiB
C#
using Cysharp.Threading.Tasks;
|
|
using Simulator.Config;
|
|
using System;
|
|
using UnityEngine;
|
|
using UVC.Core;
|
|
using UVC.Data;
|
|
using UVC.Data.Mqtt;
|
|
using UVC.Locale;
|
|
using UVC.Util;
|
|
|
|
namespace Simulator
|
|
{
|
|
[DefaultExecutionOrder(100)]
|
|
public class SimulatorAppMain : SingletonApp<SimulatorAppMain>
|
|
{
|
|
|
|
public Action Initialized;
|
|
|
|
|
|
/// <summary>
|
|
/// 초기 화 메서드입니다.
|
|
/// Awake 메서드에서 호출되며, MonoBehaviour가 생성될 때 한 번만 실행됩니다.
|
|
/// </summary>
|
|
protected override void Init()
|
|
{
|
|
InitAsync().Forget();
|
|
}
|
|
|
|
private async UniTaskVoid InitAsync()
|
|
{
|
|
await SetupConfigAsync();
|
|
if (Initialized != null)
|
|
{
|
|
Initialized.Invoke();
|
|
}
|
|
}
|
|
|
|
private async UniTask SetupConfigAsync()
|
|
{/*
|
|
if (AppConfig.LoadConfig())
|
|
{
|
|
Application.targetFrameRate = AppConfig.Config.TargetFrameRate;
|
|
|
|
//기본 언어 설정
|
|
bool success = LocalizationManager.Instance.LoadDefaultLocalizationData(AppConfig.Config.Language);
|
|
Debug.Log($"LocalizationManager: LoadDefaultLocalizationData success: {success}");
|
|
if (!Application.isEditor && Application.platform == RuntimePlatform.WindowsPlayer)
|
|
{
|
|
//창 설정
|
|
if (AppConfig.Config.Window != null)
|
|
{
|
|
WindowTools.Instance.Init(AppConfig.Config.Window);
|
|
}
|
|
}
|
|
|
|
Constants.API_DOMAIN = AppConfig.Config.Api;
|
|
Constants.MQTT_DOMAIN = AppConfig.Config.Mqtt.Domain;
|
|
Constants.MQTT_PORT = AppConfig.Config.Mqtt.Port;
|
|
Constants.MQTT_DATA_KEY = AppConfig.Config.Mqtt.DataKey;
|
|
Constants.MQTT_MESSAGEPACK_ENABLED = AppConfig.Config.Mqtt.MessagePack;
|
|
}
|
|
|
|
//사용자 DataMask 설정 AppData에서 로드
|
|
await UserSetting.LoadFromAppData();
|
|
*/
|
|
}
|
|
|
|
public void SetNetworkConfig()
|
|
{
|
|
DataRepository.Instance.MqttReceiver.SetDomainPort(Constants.MQTT_DOMAIN, Constants.MQTT_PORT);
|
|
}
|
|
|
|
}
|
|
}
|