com.alicizax.unity/Runtime/Constant/FrameworkPublishSettings.cs
2025-02-10 15:29:53 +08:00

45 lines
1.6 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()
{
RemoteURLConfigSetting configSetting = Configs.Find(s => s.Version_Type == AppStageType);
return configSetting;
}
System.Collections.IEnumerable GetAllType
{
get { return Configs.Select(a => a.Version_Type).ToList(); }
}
}
[Serializable]
public class RemoteURLConfigSetting
{
[TableColumnWidth(200, Resizable = false)]
public string Version_Type = "";
public string CheckUrl = "";
}
}