(client) feat:新增人物角色的部分定义(Character,DrawingOrder,DrawNode)
This commit is contained in:
48
Client/Assets/Scripts/Data/CharacterDefine.cs
Normal file
48
Client/Assets/Scripts/Data/CharacterDefine.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
public class Character : Define
|
||||
{
|
||||
public DrawingOrder
|
||||
drawingOrder_down,
|
||||
drawingOrder_up,
|
||||
drawingOrder_left,
|
||||
drawingOrder_right;
|
||||
}
|
||||
|
||||
public class DrawingOrder : Define
|
||||
{
|
||||
public List<DrawNode> DrawNodes { get; set; } = new List<DrawNode>();
|
||||
|
||||
public override bool Init(XElement xmlDef)
|
||||
{
|
||||
base.Init(xmlDef);
|
||||
foreach (var node in xmlDef.Elements("DrawNodes"))
|
||||
{
|
||||
DrawNode drawNode = new DrawNode();
|
||||
drawNode.Init(node);
|
||||
DrawNodes.Add(drawNode);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public partial class DrawNode : Define
|
||||
{
|
||||
public string NodeName { get; set; }
|
||||
public List<DrawNode> Children { get; set; } = new();
|
||||
public override bool Init(XElement xmlDef)
|
||||
{
|
||||
base.Init(xmlDef);
|
||||
NodeName = xmlDef.Attribute("name")?.Value;
|
||||
foreach (var childNode in xmlDef.Elements("DrawNode"))
|
||||
{
|
||||
DrawNode child = new DrawNode();
|
||||
child.Init(childNode);
|
||||
Children.Add(child);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/CharacterDefine.cs.meta
Normal file
3
Client/Assets/Scripts/Data/CharacterDefine.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e277dc789917427a81ab775cb5e74107
|
||||
timeCreated: 1752403551
|
Reference in New Issue
Block a user