(client) feat:实现摄像机跟踪与移动,实现任意位置生成实体,实现更安全的资源加载方式(指定unity内部加载资源) (#42)

Co-authored-by: zzdxxz <2079238449@qq.com>
Co-committed-by: zzdxxz <2079238449@qq.com>
This commit is contained in:
2025-08-07 16:44:43 +08:00
committed by TheRedApricot
parent 82dc89c890
commit 670f778eee
143 changed files with 9706 additions and 8122 deletions

View File

@ -0,0 +1,48 @@
using System.Collections.Generic;
using System.Xml.Linq;
namespace Data
{
public class TileDef : Define
{
public ImageDef texture;
public string name = "";
public override bool Init(XElement xmlDef)
{
base.Init(xmlDef);
name = defName;
return false;
}
}
public class TileMappingTableDef : Define
{
public Dictionary<string, string> tileDict = new();
public override bool Init(XElement xmlDef)
{
base.Init(xmlDef);
// 清空字典以确保没有遗留数据
tileDict.Clear();
// 检查 xmlDef 是否为空
if (xmlDef == null)
return false;
foreach (var element in xmlDef.Elements())
{
// 获取子元素的名称作为键
var key = element.Name.LocalName;
// 获取子元素的 value 属性作为值
var value = element.Attribute("value")?.Value;
// 检查 value 是否存在
if (!string.IsNullOrEmpty(value))
{
tileDict[key] = value;
}
}
return true;
}
}
}