(client) feat:添加游玩时UI相关贴图,添加3d模型场景按钮,添加多级调色进度条,添加SVG图片包,添加事件定义以及管理器,添加音频管理器,定义部分怪物,添加通信协议定义;fix:修复维度切换错误,修复LogUI显示不正确 (#55)

Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com>
Reviewed-on: #55
This commit is contained in:
2025-09-03 19:59:22 +08:00
parent 450b15e4df
commit 78849e0cc5
208 changed files with 16296 additions and 2228 deletions

View File

@ -8,8 +8,8 @@ namespace Data
public float moveSpeed = 1;
public int attack = 1;
public int defense = 0;
public int attackSpeed = 2;
public int attackRange = 3;
public float attackSpeed = 2;
public float attackRange = 3;
public int attackTargetCount = 1;
}
}

View File

@ -0,0 +1,65 @@
using Entity;
namespace Data
{
public class AttributesOffsetDef : Define
{
// ======================================================================
// 绝对值偏移 (Added/Subtracted directly)
// ======================================================================
public float healthOffset = 0f;
public float moveSpeedOffset = 0f;
public float attackOffset = 0f;
public float defenseOffset = 0f;
public float attackSpeedOffset = 0f;
public float attackRangeOffset = 0f;
public float attackTargetCountOffset = 0f;
// ======================================================================
// 百分比偏移 (Multiplied as a factor, e.g., 0.1 for +10%)
// ======================================================================
public float healthPercentOffset = 0f; // 例如 0.1 表示 +10%
public float moveSpeedPercentOffset = 0f;
public float attackPercentOffset = 0f;
public float defensePercentOffset = 0f;
public float attackSpeedPercentOffset = 0f;
public float attackRangePercentOffset = 0f;
public float attackTargetCountPercentOffset = 0f;
/// <summary>
/// 重载 + 操作符,用于合并两个 AttributesOffsetDef 实例。
/// </summary>
/// <param name="a">第一个属性修正定义。</param>
/// <param name="b">第二个属性修正定义。</param>
/// <returns>一个新的 AttributesOffsetDef 实例,包含两个输入的累加值。</returns>
public static AttributesOffsetDef operator +(AttributesOffsetDef a, AttributesOffsetDef b)
{
// 处理 null 情况,如果其中一个为 null则返回另一个的副本或一个空实例如果两者都为 null
if (a == null && b == null) return new AttributesOffsetDef();
if (a == null) return b; // 如果 a 是 null返回 b 的值
if (b == null) return a; // 如果 b 是 null返回 a 的值
var combined = new AttributesOffsetDef
{
// 绝对值偏移累加
healthOffset = a.healthOffset + b.healthOffset,
moveSpeedOffset = a.moveSpeedOffset + b.moveSpeedOffset,
attackOffset = a.attackOffset + b.attackOffset,
defenseOffset = a.defenseOffset + b.defenseOffset,
attackSpeedOffset = a.attackSpeedOffset + b.attackSpeedOffset,
attackRangeOffset = a.attackRangeOffset + b.attackRangeOffset,
attackTargetCountOffset = a.attackTargetCountOffset + b.attackTargetCountOffset,
// 百分比偏移累加
healthPercentOffset = a.healthPercentOffset + b.healthPercentOffset,
moveSpeedPercentOffset = a.moveSpeedPercentOffset + b.moveSpeedPercentOffset,
attackPercentOffset = a.attackPercentOffset + b.attackPercentOffset,
defensePercentOffset = a.defensePercentOffset + b.defensePercentOffset,
attackSpeedPercentOffset = a.attackSpeedPercentOffset + b.attackSpeedPercentOffset,
attackRangePercentOffset = a.attackRangePercentOffset + b.attackRangePercentOffset,
attackTargetCountPercentOffset = a.attackTargetCountPercentOffset + b.attackTargetCountPercentOffset
};
return combined;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fb6190c213d44e04946784c3a5063e83
timeCreated: 1756302637

View File

@ -0,0 +1,7 @@
namespace Data
{
public class AudioDef:Define
{
public string path;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ea58fdcb622943429532fd1b9d264340
timeCreated: 1756397633

View File

@ -149,6 +149,8 @@ namespace Data
public string packID;
public string packRootPath;
public int priority = -1;
public string Name
{
get

View File

@ -231,7 +231,7 @@ namespace Data
public List<DrawNodeDef> nodes = new();
public string nodeName;
public Vector2 position = new(0, 0);
public float FPS = 0.5f;
public float FPS = 1f;
public override bool Init(XElement xmlDef)
{

View File

@ -7,8 +7,9 @@ namespace Data
public BehaviorTreeDef behaviorTree;
public AffiliationDef affiliation;
public DrawNodeDef deathAnimation;
public EventDef[] deathEffects;
}

View File

@ -1,21 +1,8 @@
namespace Data
{
public enum EventType
{
None,
SpawnCharacter,
SpawnBuilding,
SpawnBullet,
SpawnPickup,
SpawnDefaultEntity,
}
public class EventDef : Define
{
public EventType eventType = EventType.None;
public EntityDef entityDef_Character; // 用于 EventType.SpawnCharacter
public BuildingDef entityDef_Building; // 用于 EventType.SpawnBuilding
public BulletDef entityDef_Bullet; // 用于 EventType.SpawnBullet
public ItemDef entityDef_Pickup; // 用于 EventType.SpawnPickup
public EventDef() { }
public string workClass;
public string value;
}
}

View File

@ -0,0 +1,17 @@
using System;
using System.Xml.Linq;
namespace Data
{
public class HediffCompDef:Define
{
public Type compClass;
public override bool Init(XElement xmlDef)
{
base.Init(xmlDef);
var name = xmlDef.Attribute("class")?.Value??"";
compClass=Type.GetType(name);
return true;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 92779af4b74648a99930c10376760af6
timeCreated: 1756303386

View File

@ -0,0 +1,13 @@
using System.Collections.Generic;
namespace Data
{
public class HediffDef:Define
{
public float time = -1;
// Hediff的发展阶段列表
public List<HediffStageDef> stages = new List<HediffStageDef>();
// 附加的组件列表
public List<HediffCompDef> comps = new List<HediffCompDef>();
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a4311115be2f4da8a5a27e1bb298928e
timeCreated: 1756303757

View File

@ -0,0 +1,8 @@
namespace Data
{
public class HediffStageDef:Define
{
public float start;
public AttributesOffsetDef attributesOffset = new();
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 59d3b562e68e40fdaa65e5e6431c58e0
timeCreated: 1756304101

View File

@ -4,7 +4,6 @@ namespace Data
{
public class ImageDef : Define
{
public string name;
public string path;
public int wCount;
public int hCount;
@ -13,7 +12,6 @@ namespace Data
public override bool Init(XElement xmlDef)
{
base.Init(xmlDef);
name = defName;
return false;
}
}

View File

@ -0,0 +1,47 @@
namespace Data
{
/// <summary>
/// 定义提示文本在游戏或应用中显示方式的类别。
/// Defines categories for how prompt text is displayed in a game or application.
/// </summary>
public enum PromptDisplayCategory
{
/// <summary>
/// 默认或未分类的显示方式。
/// Default or uncategorized display method.
/// </summary>
Default = 0,
/// <summary>
/// 显示在玩家当前焦点实体例如NPC或交互物上方以聊天气泡的形式呈现。
/// Displayed as a chat bubble above the player's currently focused entity (e.g., NPC, interactive object).
/// </summary>
FocusedEntityChatBubble,
/// <summary>
/// 显示在玩家当前焦点实体例如NPC或交互物的头顶通常是简短的状态、名称或互动提示。
/// Displayed as text above the player's currently focused entity (e.g., NPC, interactive object), typically for short status, names, or interaction prompts.
/// </summary>
FocusedEntityOverheadText,
/// <summary>
/// 大型文本显示在屏幕中央,通常用于重要通知、标题或剧情提示,需要玩家立即注意。
/// Large text displayed in the center of the screen, typically for important announcements, titles, or narrative prompts that demand immediate player attention.
/// </summary>
ScreenCenterLargeText,
/// <summary>
/// 非焦点提示通常以不易干扰的方式如屏幕边缘、HUD小字或右下角浮动显示提供辅助信息、次要指引或环境提示。
/// Non-focused hint, typically displayed in a non-intrusive way (e.g., screen corner, small HUD text, or bottom-right floating message) to provide auxiliary information, minor guidance, or environmental cues.
/// </summary>
PassiveHint,
}
public class MessageDef : Define
{
public PromptDisplayCategory type;
public string text;
public string color;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8df8531d3d53412e8c299262aeea6f57
timeCreated: 1756860490

View File

@ -0,0 +1,11 @@
namespace Data
{
public class SkillTreeDef:Define
{
public string tag="Default";
public AffiliationDef faction;
public SkillTreeDef[] prerequisites;
public WeaponDef[] unlockedWeapons;
public HediffDef[] unlockedHediffs;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 08ca1b39c5b342ceb23bd565d433ac66
timeCreated: 1756705012

View File

@ -0,0 +1,14 @@
namespace Data
{
public class StoryStageDef : Define
{
public float lastWaitTime = 0;
public float nextWaitTime = 0;
public EventDef eventDef;
public MessageDef messageDef;
}
public class StoryDef:Define
{
public StoryStageDef[] storyStage;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: e11d701b7d8b4af0a947d630884bfeab
timeCreated: 1756306428