第一批重构,主要是物理迁移脚本和部分命名空间的调整

- 结构上迁移文件,将脚本分成 Base/Runtime/Presentation/Procedure/Editor 五大文件夹
- 调整 DataTable 和 Definition 下脚本的命名空间
- 依据 UI-5层架构设计规范 拆分原先的 UI 到 Runtime 和 Presentation 下
This commit is contained in:
SepComet
2026-06-02 19:12:34 +08:00
parent 56f74eee9a
commit 34c0784190
655 changed files with 1272 additions and 516 deletions
@@ -0,0 +1,54 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
namespace SepCore.Definition
{
public class BuildInfo
{
public string GameVersion
{
get;
set;
}
public int InternalGameVersion
{
get;
set;
}
public string CheckVersionUrl
{
get;
set;
}
public string WindowsAppUrl
{
get;
set;
}
public string MacOSAppUrl
{
get;
set;
}
public string IOSAppUrl
{
get;
set;
}
public string AndroidAppUrl
{
get;
set;
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 265686b0408d79949a657768398c72cc
timeCreated: 1528026149
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,37 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
using System.Runtime.InteropServices;
using SepCore.Definition;
namespace SepCore.Definition
{
[StructLayout(LayoutKind.Auto)]
public struct ImpactData
{
public ImpactData(CampType camp /*, int health*/, int attackBase, StatProperty attackStat = null,
StatProperty defenseStat = null, StatProperty dodgeStat = null)
{
Camp = camp;
//Health = health;
AttackBase = attackBase;
AttackStat = attackStat;
DefenseStat = defenseStat;
DodgeStat = dodgeStat;
}
public CampType Camp { get; }
public int AttackBase { get; }
public StatProperty AttackStat { get; }
public StatProperty DefenseStat { get; }
public StatProperty DodgeStat { get; }
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 22538aa3f76228d48819a9942febb66d
timeCreated: 1528026149
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,56 @@
using Components;
using SepCore.DataTable;
using SepCore.Definition;
namespace SepCore.Definition
{
public class PropItem
{
private readonly StatModifier[] _modifiers;
public string Title { get; private set; }
public string IconAssetName { get; private set; }
public ItemRarity Rarity { get; private set; }
public StatModifier[] Modifiers => _modifiers;
public PropItem(DRProp prop)
{
if (prop == null) return;
_modifiers = prop.Modifiers;
Title = prop.Title;
Rarity = prop.Rarity;
IconAssetName = prop.IconAssetName;
}
public PropItem(StatModifier[] modifiers)
{
_modifiers = modifiers;
}
public PropItem(StatModifier[] modifiers, ItemRarity rarity, string title, string iconAssetName)
{
_modifiers = modifiers;
Title = title;
Rarity = rarity;
IconAssetName = iconAssetName;
}
public void OnAttach(StatComponent statComponent)
{
if (_modifiers == null || statComponent == null) return;
foreach (var modifier in _modifiers)
{
statComponent.AddModifier(modifier);
}
}
public void OnDetach(StatComponent statComponent)
{
if (_modifiers == null || statComponent == null) return;
foreach (var modifier in _modifiers)
{
statComponent.RemoveModifier(modifier);
}
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 135b5ab1b6f5491989f080cf8b949201
timeCreated: 1770212750
@@ -0,0 +1,93 @@
using System;
using SepCore.Definition;
using CustomUtility;
using UnityGameFramework.Runtime;
namespace SepCore.Definition
{
public class StatModifier
{
// None = 0,
// MaxHealth = 1,
// MovementSpeed = 2,
// Attack = 3,
// Defense = 4,
// AttackSpeed = 5,
// Critical = 6,
// CriticalDamage = 7,
// Dodge = 8,
// AbsorbRange = 9
private readonly string[] _statTypeNames =
{
"无效",
"最大生命",
"移动速度",
"伤害",
"防御",
"冷却",
"暴击率",
"暴击伤害",
"闪避",
"金币/经验吸收范围"
};
public StatType StatType;
public float Value;
public bool IsPercent;
public override string ToString()
{
if (IsPercent)
{
if (Value > 0)
{
return $"{_statTypeNames[(int)StatType]}: <color=green>+{Value * 100}%</color>";
}
else
{
return $"{_statTypeNames[(int)StatType]}: <color=red>+{Value * 100}%</color>";
}
}
else
{
if (Value > 0)
{
return $"{_statTypeNames[(int)StatType]}: <color=green>+{Value}</color>";
}
else
{
return $"{_statTypeNames[(int)StatType]}: <color=red>+{Value}</color>";
}
}
}
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,11 @@
fileFormatVersion: 2
guid: 4f70088ee3846934796f2cacb72fd920
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
namespace SepCore.Definition
{
public class StatProperty
{
public float Value;
public float Percent;
public StatProperty()
{
Value = 0f;
Percent = 1f;
}
public StatProperty(float value, float percent)
{
Value = value;
Percent = percent;
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 18e7bc9587114ae4a91c70f829543de8
timeCreated: 1770353735
@@ -0,0 +1,75 @@
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------
namespace SepCore.Definition
{
public class VersionInfo
{
// 是否需要强制更新游戏应用
public bool ForceUpdateGame
{
get;
set;
}
// 最新的游戏版本号
public string LatestGameVersion
{
get;
set;
}
// 最新的游戏内部版本号
public int InternalGameVersion
{
get;
set;
}
// 最新的资源内部版本号
public int InternalResourceVersion
{
get;
set;
}
// 资源更新下载地址
public string UpdatePrefixUri
{
get;
set;
}
// 资源版本列表长度
public int VersionListLength
{
get;
set;
}
// 资源版本列表哈希值
public int VersionListHashCode
{
get;
set;
}
// 资源版本列表压缩后长度
public int VersionListCompressedLength
{
get;
set;
}
// 资源版本列表压缩后哈希值
public int VersionListCompressedHashCode
{
get;
set;
}
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f1245482e9f20354796d50d6d85d2fe0
timeCreated: 1528026150
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: