迁移数据表到 Luban,移除 JsonNet、EnumUtility
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e86225af5c8e9e44804e796e7972b29
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public sealed partial class LevelExperienceConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 转换为按目标等级为下标索引的经验需求数组。
|
||||
/// 下标 0 为 0(无目标 0 级),下标 1 为达到 1 级所需经验(即 Lv0 对应经验 100),以此类推。
|
||||
/// 与 Player.cs 中 _expRequires[_currentLevel + 1] 的升级判定逻辑完全匹配。
|
||||
/// </summary>
|
||||
public int[] ToTargetLevelArray()
|
||||
{
|
||||
return new int[]
|
||||
{
|
||||
0,
|
||||
Lv0, Lv1, Lv2, Lv3, Lv4, Lv5, Lv6, Lv7, Lv8, Lv9,
|
||||
Lv10, Lv11, Lv12, Lv13, Lv14, Lv15, Lv16, Lv17, Lv18, Lv19,
|
||||
Lv20, Lv21, Lv22, Lv23, Lv24, Lv25, Lv26, Lv27, Lv28, Lv29,
|
||||
Lv30, Lv31, Lv32, Lv33, Lv34, Lv35, Lv36, Lv37, Lv38, Lv39,
|
||||
Lv40, Lv41, Lv42, Lv43, Lv44, Lv45, Lv46, Lv47, Lv48, Lv49,
|
||||
Lv50, Lv51, Lv52, Lv53, Lv54, Lv55, Lv56, Lv57, Lv58, Lv59,
|
||||
Lv60
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转换为包含 Lv0~Lv60 的原始数组(长度 61)。
|
||||
/// </summary>
|
||||
public int[] ToArray()
|
||||
{
|
||||
return new int[]
|
||||
{
|
||||
Lv0, Lv1, Lv2, Lv3, Lv4, Lv5, Lv6, Lv7, Lv8, Lv9,
|
||||
Lv10, Lv11, Lv12, Lv13, Lv14, Lv15, Lv16, Lv17, Lv18, Lv19,
|
||||
Lv20, Lv21, Lv22, Lv23, Lv24, Lv25, Lv26, Lv27, Lv28, Lv29,
|
||||
Lv30, Lv31, Lv32, Lv33, Lv34, Lv35, Lv36, Lv37, Lv38, Lv39,
|
||||
Lv40, Lv41, Lv42, Lv43, Lv44, Lv45, Lv46, Lv47, Lv48, Lv49,
|
||||
Lv50, Lv51, Lv52, Lv53, Lv54, Lv55, Lv56, Lv57, Lv58, Lv59,
|
||||
Lv60
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4b6d8e25599afc54bb6e29b09e606bbd
|
||||
guid: e7b3f39341ca70f439664dceb9ea7552
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public sealed partial class LevelUpRewardConfig
|
||||
{
|
||||
public string IconAssetName => $"levelupreward_{(Id >= 1000 ? Id - 900 : Id)}_icon";
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2248c02c2c5529445992a2c2fef799dd
|
||||
guid: a30aae743bbd22b4cac1ef60f96a1bed
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public sealed partial class PropConfig
|
||||
{
|
||||
public string Title => Name;
|
||||
public string IconAssetName => $"prop_{(Id >= 1000 ? Id - 900 : Id)}_icon";
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb7ab0222a370b649956dacb56a122fc
|
||||
guid: 37131c7b023611f4b83978960f4b3df4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public sealed partial class RoleConfig
|
||||
{
|
||||
public int Id => Name == "老人" ? 102 : 101;
|
||||
public string RoleName => Name;
|
||||
public string IconName => $"role_{Id}_icon";
|
||||
public int WeaponCapacity => 6;
|
||||
}
|
||||
}
|
||||
+2
-3
@@ -1,8 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 61f18b2b0752f32449d9978f481a75fc
|
||||
timeCreated: 1528026150
|
||||
licenseType: Pro
|
||||
guid: 6d60ad7c035b4aa4abd87deb1d572847
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public sealed partial class WeaponConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 图标资源名称(映射 weapon_1_icon ~ weapon_5_icon)。
|
||||
/// </summary>
|
||||
public string IconAssetName => $"weapon_{(Id >= 1000 ? Id % 1000 : Id)}_icon";
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 430f837865b92144c82328dc2ce58823
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,33 +1,40 @@
|
||||
using SepCore.DataTable;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public class PropItem
|
||||
{
|
||||
private readonly StatModifier[] _modifiers;
|
||||
private readonly List<modifier> _modifiers = new();
|
||||
public string Title { get; private set; }
|
||||
public string IconAssetName { get; private set; }
|
||||
public ItemRarity Rarity { get; private set; }
|
||||
public StatModifier[] Modifiers => _modifiers;
|
||||
public Rarity Rarity { get; private set; }
|
||||
public IReadOnlyList<modifier> Modifiers => _modifiers;
|
||||
|
||||
public PropItem(DRProp prop)
|
||||
public PropItem(PropConfig prop)
|
||||
{
|
||||
if (prop == null) return;
|
||||
|
||||
_modifiers = prop.Modifiers;
|
||||
if (prop.Modifiers != null)
|
||||
{
|
||||
_modifiers.AddRange(prop.Modifiers);
|
||||
}
|
||||
Title = prop.Title;
|
||||
Rarity = prop.Rarity;
|
||||
IconAssetName = prop.IconAssetName;
|
||||
}
|
||||
|
||||
public PropItem(StatModifier[] modifiers)
|
||||
public PropItem(IEnumerable<modifier> modifiers)
|
||||
{
|
||||
_modifiers = modifiers;
|
||||
if (modifiers != null)
|
||||
{
|
||||
_modifiers.AddRange(modifiers);
|
||||
}
|
||||
}
|
||||
|
||||
public PropItem(StatModifier[] modifiers, ItemRarity rarity, string title, string iconAssetName)
|
||||
public PropItem(IEnumerable<modifier> modifiers, Rarity rarity, string title, string iconAssetName)
|
||||
{
|
||||
_modifiers = modifiers;
|
||||
if (modifiers != null)
|
||||
{
|
||||
_modifiers.AddRange(modifiers);
|
||||
}
|
||||
Title = title;
|
||||
Rarity = rarity;
|
||||
IconAssetName = iconAssetName;
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using SepCore.Definition;
|
||||
using SepCore.CustomUtility;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public class StatModifier
|
||||
{
|
||||
public StatType StatType;
|
||||
public float Value;
|
||||
public bool IsPercent;
|
||||
|
||||
public static StatModifier StringToModifier(string input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
Log.Warning("Invalid modifier: {0}", input);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!input.StartsWith('[') || !input.EndsWith(']'))
|
||||
{
|
||||
throw new ArgumentException("Input must be enclosed in square brackets.");
|
||||
}
|
||||
|
||||
string inner = input.Substring(1, input.Length - 2);
|
||||
|
||||
// 如果是空列表 "[]"
|
||||
if (inner.Length == 0) return null;
|
||||
|
||||
string[] property = inner.Split(",");
|
||||
int propertyIndex = 0;
|
||||
return new StatModifier
|
||||
{
|
||||
StatType = EnumUtility<StatType>.Get(property[propertyIndex++]),
|
||||
Value = float.Parse(property[propertyIndex++]),
|
||||
IsPercent = bool.Parse(property[propertyIndex++])
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public sealed partial class modifier
|
||||
{
|
||||
public StatType StatType => Key;
|
||||
|
||||
/// <summary>
|
||||
/// 实际参与数值计算的浮点数值。
|
||||
/// 1. 百分比加成(IsPercent == true):表内千分比(如 200 代表 20%),转换为 0.2f。
|
||||
/// 2. 非百分比加成(IsPercent == false):移动速度原为 float 放大了 1000 倍(如 800 代表 0.8f),除以 1000f;其余(如生命+53、攻击+10)直接使用原值。
|
||||
/// </summary>
|
||||
public float RealValue
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsPercent)
|
||||
{
|
||||
return Value / 1000f;
|
||||
}
|
||||
|
||||
if (Key == StatType.MovementSpeed)
|
||||
{
|
||||
return Value / 1000f;
|
||||
}
|
||||
|
||||
return Value;
|
||||
}
|
||||
}
|
||||
|
||||
public modifier()
|
||||
{
|
||||
}
|
||||
|
||||
public modifier(StatType key, int value, bool isPercent)
|
||||
{
|
||||
Key = key;
|
||||
Value = value;
|
||||
IsPercent = isPercent;
|
||||
}
|
||||
|
||||
public modifier(StatType key, float value, bool isPercent)
|
||||
{
|
||||
Key = key;
|
||||
Value = (isPercent || key == StatType.MovementSpeed)
|
||||
? Mathf.RoundToInt(value * 1000f)
|
||||
: Mathf.RoundToInt(value);
|
||||
IsPercent = isPercent;
|
||||
}
|
||||
|
||||
public string ToDisplayString()
|
||||
{
|
||||
if (IsPercent)
|
||||
{
|
||||
float percent = Value / 10f;
|
||||
return $"{Key} +{percent:0.##}%";
|
||||
}
|
||||
|
||||
if (Key == StatType.MovementSpeed)
|
||||
{
|
||||
float speed = Value / 1000f;
|
||||
return $"{Key} +{speed:0.##}";
|
||||
}
|
||||
|
||||
return $"{Key} +{Value}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public enum BulletType : byte
|
||||
{
|
||||
None = 0,
|
||||
BulletHandgun = 1
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 阵营类型。
|
||||
/// </summary>
|
||||
public enum CampType : byte
|
||||
{
|
||||
Unknown = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 第一玩家阵营。
|
||||
/// </summary>
|
||||
Player,
|
||||
|
||||
/// <summary>
|
||||
/// 第一敌人阵营。
|
||||
/// </summary>
|
||||
Enemy,
|
||||
|
||||
/// <summary>
|
||||
/// 第一中立阵营。
|
||||
/// </summary>
|
||||
Neutral,
|
||||
|
||||
/// <summary>
|
||||
/// 第二玩家阵营。
|
||||
/// </summary>
|
||||
Player2,
|
||||
|
||||
/// <summary>
|
||||
/// 第二敌人阵营。
|
||||
/// </summary>
|
||||
Enemy2,
|
||||
|
||||
/// <summary>
|
||||
/// 第二中立阵营
|
||||
/// </summary>
|
||||
Neutral2,
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public enum GoodsType
|
||||
{
|
||||
None = 0,
|
||||
Weapon,
|
||||
Prop
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public enum ItemRarity
|
||||
{
|
||||
None,
|
||||
White = 1,
|
||||
Green = 2,
|
||||
Blue,
|
||||
Purple,
|
||||
Red
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 关系类型。
|
||||
/// </summary>
|
||||
public enum RelationType : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// 未知的。
|
||||
/// </summary>
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// 友好的。
|
||||
/// </summary>
|
||||
Friendly,
|
||||
|
||||
/// <summary>
|
||||
/// 中立的。
|
||||
/// </summary>
|
||||
Neutral,
|
||||
|
||||
/// <summary>
|
||||
/// 敌对的。
|
||||
/// </summary>
|
||||
Hostile
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c5c37ca396eb9d47a70999b5825152b
|
||||
timeCreated: 1528026150
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public enum SceneId : byte
|
||||
{
|
||||
Launch = 0,
|
||||
Menu = 1,
|
||||
Main = 2,
|
||||
|
||||
StressTest = 3,
|
||||
Game = 4,
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 20fc28f41ef04f8fa4fbfb9189b58d0d
|
||||
timeCreated: 1768899171
|
||||
@@ -1,17 +0,0 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public enum StatType
|
||||
{
|
||||
None = 0,
|
||||
|
||||
MaxHealth = 1,
|
||||
MovementSpeed = 2,
|
||||
Attack = 3,
|
||||
Defense = 4,
|
||||
AttackSpeed = 5,
|
||||
Critical = 6,
|
||||
CriticalDamage = 7,
|
||||
Dodge = 8,
|
||||
AbsorbRange = 9,
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 657fd4fd021a424397aa17c0359a1da1
|
||||
timeCreated: 1768966119
|
||||
@@ -1,67 +0,0 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// 界面编号。
|
||||
/// </summary>
|
||||
public enum UIFormType : byte
|
||||
{
|
||||
Undefined = 0,
|
||||
|
||||
/// <summary>
|
||||
/// 弹出框。
|
||||
/// </summary>
|
||||
DialogForm = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 主菜单。
|
||||
/// </summary>
|
||||
MenuForm = 100,
|
||||
|
||||
/// <summary>
|
||||
/// 设置。
|
||||
/// </summary>
|
||||
SettingForm = 101,
|
||||
|
||||
/// <summary>
|
||||
/// 关于。
|
||||
/// </summary>
|
||||
AboutForm = 102,
|
||||
|
||||
/// <summary>
|
||||
/// 选择角色。
|
||||
/// </summary>
|
||||
SelectRoleForm = 201,
|
||||
|
||||
/// <summary>
|
||||
/// 游戏商店。
|
||||
/// </summary>
|
||||
ShopForm = 202,
|
||||
|
||||
/// <summary>
|
||||
/// 游戏HUD。
|
||||
/// </summary>
|
||||
HudForm = 203,
|
||||
|
||||
/// <summary>
|
||||
/// 升级选择。
|
||||
/// </summary>
|
||||
LevelUpForm = 204,
|
||||
|
||||
/// <summary>
|
||||
/// 物品信息展示页
|
||||
/// </summary>
|
||||
ItemTooltipForm = 205,
|
||||
|
||||
/// <summary>
|
||||
/// 虚拟摇杆。
|
||||
/// </summary>
|
||||
JoystickForm = 206,
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 75fd10c7585513846ab25372be0590b7
|
||||
timeCreated: 1528026162
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,12 +1,12 @@
|
||||
namespace SepCore.Definition
|
||||
{
|
||||
public enum WeaponType : byte
|
||||
public enum WeaponType : int
|
||||
{
|
||||
None = 0,
|
||||
WeaponKnife = 1,
|
||||
WeaponHandgun = 2,
|
||||
WeaponSlash = 3,
|
||||
WeaponLightning = 4,
|
||||
WeaponLance = 5,
|
||||
WeaponKnife = 1001,
|
||||
WeaponHandgun = 1002,
|
||||
WeaponSlash = 1003,
|
||||
WeaponLightning = 1004,
|
||||
WeaponLance = 1005,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user