(client) chroe:CharacterDef允许默认加载

This commit is contained in:
m0_75251201
2025-07-14 17:14:45 +08:00
parent 832358d732
commit c7f0af7877
3 changed files with 17 additions and 9 deletions

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using UnityEditor.ShaderGraph.Internal;
@ -23,6 +24,7 @@ namespace Data
public class CharacterDef : Define
{
public CharacterAttributesDef attributes;
public string texturePath = null;
public DrawingOrderDef
drawingOrder_down,
@ -71,14 +73,18 @@ namespace Data
public override bool Init(XElement xmlDef)
{
base.Init(xmlDef);
foreach (var node in xmlDef.Elements("DrawNodeDef"))
{
var drawNode = new DrawNodeDef();
drawNode.Init(node);
drawNodes.Add(drawNode);
}
return true;
var nodes = xmlDef.Elements("DrawNodeDef");
if (nodes.Count() == 0)
return false;
foreach (var node in nodes)
{
var drawNode = new DrawNodeDef();
drawNode.Init(node);
drawNodes.Add(drawNode);
}
return true;;
}
}