93 lines
2.3 KiB
C#
93 lines
2.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using GameCore;
|
|
|
|
namespace GameLogic {
|
|
[System.Serializable]
|
|
public class ServerInfo
|
|
{
|
|
public string ServerName;
|
|
public string ServerUrl;
|
|
}
|
|
|
|
[System.Serializable]
|
|
public class SettingInfo
|
|
{
|
|
/// <summary>
|
|
/// logLevel
|
|
/// </summary>
|
|
public LogLevel logLevel;
|
|
/// <summary>
|
|
/// 是否为debug
|
|
/// </summary>
|
|
public bool isDebug;
|
|
/// <summary>
|
|
/// 是否为ab包模式
|
|
/// </summary>
|
|
public bool bundleMode;
|
|
/// <summary>
|
|
/// 是否开启LuaAB包模式
|
|
/// </summary>
|
|
public bool luaBundleMode;
|
|
/// <summary>
|
|
/// 是否开启热更新
|
|
/// </summary>
|
|
public bool isUpdate;
|
|
/// <summary>
|
|
/// 是否开启SDK
|
|
/// </summary>
|
|
public bool isSDK;
|
|
/// <summary>
|
|
/// 是否开启SDK登录
|
|
/// </summary>
|
|
public bool isSDKLogin;
|
|
/// <summary>
|
|
/// 是否开启新手引导
|
|
/// </summary>
|
|
public bool isGuide;
|
|
/// <summary>
|
|
/// 是否开启GM
|
|
/// </summary>
|
|
public bool isOpenGM;
|
|
}
|
|
|
|
[ExecuteInEditMode]
|
|
/// <summary>
|
|
/// 游戏设置
|
|
/// </summary>
|
|
public class GameSettings : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
public SettingInfo settingInfo;
|
|
void Awake()
|
|
{
|
|
InitGameSettings();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
// InitGameSettings();
|
|
|
|
}
|
|
|
|
void InitGameSettings()
|
|
{
|
|
if (settingInfo != null)
|
|
{
|
|
BaseLogger.isDebug = settingInfo.isDebug;
|
|
BaseLogger.level = settingInfo.logLevel;
|
|
AppConst.bundleMode = settingInfo.bundleMode;
|
|
AppConst.isUpdate = settingInfo.isUpdate;
|
|
AppConst.isGuide = settingInfo.isGuide;
|
|
AppConst.isOpenGM = settingInfo.isOpenGM;
|
|
AppConst.isSDK = settingInfo.isSDK;
|
|
AppConst.isSDKLogin = settingInfo.isSDKLogin;
|
|
AppConst.luaBundleMode = settingInfo.luaBundleMode;
|
|
}
|
|
Application.targetFrameRate = AppConst.GameFrameRate;
|
|
}
|
|
}
|
|
|
|
}
|