com.alicizax.unity/Runtime/Constant/FrameworkPublishSettings.cs
2025-02-21 14:42:15 +08:00

59 lines
2.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Sirenix.OdinInspector;
using UnityEngine;
namespace AlicizaX.Runtime
{
[Serializable]
public class FrameworkPublishSettings : ScriptableObject
{
[BoxGroup("版本配置", true)] [TableList(ShowIndexLabels = false, DrawScrollView = true, MaxScrollViewHeight = 200, AlwaysExpanded = true)]
public List<RemoteURLConfigSetting> Configs = new List<RemoteURLConfigSetting>
{
new RemoteURLConfigSetting() { Version_Type = "Release", CheckUrl = "http://127.0.0.1:8080/UpdateData.json" },
new RemoteURLConfigSetting() { Version_Type = "Dev", CheckUrl = "http://127.0.0.1:8080/UpdateData.json" },
new RemoteURLConfigSetting() { Version_Type = "Test", CheckUrl = "http://127.0.0.1:8080/UpdateData.json" },
};
[BoxGroup("版本配置", true)] [LabelText("当前版本")] [ValueDropdown("GetAllType", ExpandAllMenuItems = true)] [SerializeField]
public string AppStageType = "Dev";
public RemoteURLConfigSetting GetConfig()
{
return Configs.Find(s => s.Version_Type == AppStageType);
}
[ValueDropdown("GetResMode")] [BoxGroup("发布设置")] [LabelText("资源模式")]
public int ResMode;
[BoxGroup("发布设置")] [LabelText("默认语言")] public Language Language = Runtime.Language.ChineseSimplified;
private System.Collections.IEnumerable GetAllType
{
get { return Configs.Select(a => a.Version_Type).ToList(); }
}
private static System.Collections.IEnumerable GetResMode = new ValueDropdownList<int>()
{
{ "EditorSimulateMode", 0 },
{ "OfflinePlayMode", 1 },
{ "HostPlayMode", 2 },
{ "WebPlayMode", 3 },
};
}
[Serializable]
public class RemoteURLConfigSetting
{
[TableColumnWidth(200, Resizable = false)]
public string Version_Type = "";
public string CheckUrl = "";
}
}