You've already forked taptap2024_GJ_chidouren
90 lines
2.7 KiB
C#
90 lines
2.7 KiB
C#
using System.IO;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
|
|
public class GameVersionConfig : ScriptableObject
|
|
{
|
|
public int ClientBuildID;
|
|
}
|
|
|
|
public class GameGlobalConfig : GameVersionConfig
|
|
{
|
|
#region Instance Logic
|
|
|
|
private static GameGlobalConfig instance;
|
|
|
|
public static GameGlobalConfig Instance
|
|
{
|
|
get
|
|
{
|
|
#if UNITY_EDITOR
|
|
if (UnityEditor.EditorApplication.isPlaying == false)
|
|
{
|
|
instance = null;
|
|
}
|
|
#endif
|
|
if (instance == null)
|
|
{
|
|
#if UNITY_EDITOR
|
|
if (!File.Exists("Assets/Resources/GameSettings.asset"))
|
|
{
|
|
instance = CreateInstance<GameGlobalConfig>();
|
|
// 自定义资源保存路径
|
|
string path = "Assets/Resources";
|
|
//如果项目总不包含该路径,创建一个
|
|
if (!Directory.Exists(path))
|
|
{
|
|
Directory.CreateDirectory(path);
|
|
}
|
|
|
|
UnityEditor.AssetDatabase.CreateAsset(instance, path + "/GameSettings.asset");
|
|
UnityEditor.AssetDatabase.Refresh();
|
|
}
|
|
|
|
if (instance != null)
|
|
{
|
|
Resources.UnloadAsset(instance);
|
|
}
|
|
|
|
instance = Resources.Load<GameGlobalConfig>("GameSettings");
|
|
#else
|
|
instance = Resources.Load<GameGlobalConfig>("GameSettings");
|
|
#endif
|
|
}
|
|
|
|
return instance;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
[Header("游戏渠道")]public GameChannel Channel;
|
|
|
|
[BoxGroup("AssetBundle Info"),Header("拟真模式")] public bool IsNativeAssets;
|
|
[BoxGroup("AssetBundle Info"),Header("是否强制资源检查更新")] public bool IsMandatory;
|
|
[BoxGroup("AssetBundle Info"),Header("是否在启动时自动检查热更新")] public bool IsCheckNetAsset;
|
|
[BoxGroup("AssetBundle Info"),Header("热更新检查地址")] public string AssetRemotePath;
|
|
|
|
[BoxGroup("Taptap Info")] public string TapClientId;
|
|
[BoxGroup("Taptap Info")] public string TapToken;
|
|
[BoxGroup("Taptap Info")] public string TapUrl;
|
|
[BoxGroup("Taptap Info")] public string TapAppUrl;
|
|
|
|
[BoxGroup("游戏通用配置"), Header("每日最大广告上限")]public int EveryDayAdLimit = 99;
|
|
[BoxGroup("游戏通用配置"), Header("每日最大体力广告上限")]public int EveryDayPowerAdLimit = 2;
|
|
[BoxGroup("游戏通用配置"), Header("体力广告恢复CD上限 (分)")]public int PowerAdCD = 60;
|
|
}
|
|
|
|
public enum GameChannel
|
|
{
|
|
Private = 0,
|
|
Taptap,
|
|
Kuaibao,
|
|
Momoyu,
|
|
Ios,
|
|
Ohayoo,
|
|
Douyin,
|
|
Weixin
|
|
} |