97 lines
3.8 KiB
C#
97 lines
3.8 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using Continentis.MainGame.Card;
|
||
using Continentis.MainGame.Character;
|
||
using SLSFramework.General;
|
||
using SLSFramework.UModAssistance;
|
||
using UnityEngine;
|
||
using UnityEngine.Serialization;
|
||
|
||
namespace Continentis.MainGame.Equipment
|
||
{
|
||
[CreateAssetMenu(menuName = "Continentis/MainGame/Equipment/EquipmentData", fileName = "EquipmentData")]
|
||
public partial class EquipmentData : ScriptableObject
|
||
{
|
||
[Header("Fundamental")]
|
||
public bool haveCustomClass;
|
||
public string modName;
|
||
public string className;
|
||
public string displayName;
|
||
public List<string> tags;
|
||
public Rarity equipmentRarity;
|
||
public Sprite equipmentIcon;
|
||
[TextArea(1, 10)]
|
||
public string equipmentDescription;
|
||
|
||
[Header("Attributes")]
|
||
public SerializableDictionary<string, float> coreNumericChange = new SerializableDictionary<string, float>();
|
||
public SerializableDictionary<string, float> corePercentageChangeOfAccumulation = new SerializableDictionary<string, float>();
|
||
public SerializableDictionary<string, float> corePercentageChangeOfMultiplication = new SerializableDictionary<string, float>();
|
||
|
||
public SerializableDictionary<string, float> generalNumericChange = new SerializableDictionary<string, float>();
|
||
public SerializableDictionary<string, float> generalPercentageChangeOfAccumulation = new SerializableDictionary<string, float>();
|
||
public SerializableDictionary<string, float> generalPercentageChangeOfMultiplication = new SerializableDictionary<string, float>();
|
||
|
||
[Header("References")]
|
||
public List<string> prefabRefs = new List<string>();
|
||
public List<string> derivativeCardDataRefs = new List<string>();
|
||
public List<string> derivativeCharacterDataRefs = new List<string>();
|
||
[Tooltip("装备自带的卡牌的引用列表")]
|
||
public List<string> belongingCardDataRefs = new List<string>();
|
||
//[Header("Upgrades")]
|
||
//public List<EquipmentData> upgrades;
|
||
}
|
||
|
||
public partial class EquipmentData
|
||
{
|
||
public static EquipmentData Get(string dataID)
|
||
{
|
||
return ModManager.GetData<EquipmentData>(dataID);
|
||
}
|
||
}
|
||
|
||
public partial class EquipmentData
|
||
{
|
||
|
||
}
|
||
|
||
#if UNITY_EDITOR
|
||
public partial class EquipmentData
|
||
{
|
||
/*
|
||
private IEnumerable<ValueDropdownItem<Type>> GetLogicTypes()
|
||
{
|
||
IEnumerable<Type> types = AppDomain.CurrentDomain.GetAssemblies()
|
||
.SelectMany(assembly => assembly.GetTypes())
|
||
.Where(t => typeof(EquipmentBase).IsAssignableFrom(t) && !t.IsAbstract && !t.IsInterface);
|
||
|
||
// 我们将从命名空间中移除这个公共前缀,让路径更简洁
|
||
string commonNamespacePrefix = "Continentis.Mods";
|
||
|
||
foreach (var type in types)
|
||
{
|
||
string path = "Uncategorized/" + type.Name; // 默认路径
|
||
|
||
if (type.Namespace != null && type.Namespace.StartsWith(commonNamespacePrefix))
|
||
{
|
||
// 1. 移除公共前缀
|
||
string formattedNamespace = type.Namespace.Substring(commonNamespacePrefix.Length);
|
||
|
||
// 2. 移除特定的子命名空间部分(例如 "Cards")
|
||
formattedNamespace = formattedNamespace.Replace(".Equipments", "");
|
||
|
||
// 3. 将点 '.' 替换为斜杠 '/' 来创建分组
|
||
formattedNamespace = formattedNamespace.Replace('.', '/');
|
||
|
||
// 4. 组合成最终的路径
|
||
path = formattedNamespace + "/" + type.Name;
|
||
}
|
||
|
||
yield return new ValueDropdownItem<Type>(path, type);
|
||
}
|
||
}
|
||
*/
|
||
}
|
||
#endif
|
||
} |