(client) chore:Clean code

This commit is contained in:
2025-08-28 16:20:24 +08:00
parent 909e995e15
commit c3bff1cf88
76 changed files with 5689 additions and 445 deletions

View File

@ -7,10 +7,10 @@ namespace Data
public class BehaviorTreeDef : Define
{
public BehaviorTreeDef[] childTree;
public string className= "ThinkNode_Selector";
public string className = "ThinkNode_Selector";
public string value;
public override bool Init(XElement xmlDef)
{
base.Init(xmlDef);
@ -23,7 +23,7 @@ namespace Data
var xElements = nodes as XElement[] ?? nodes.ToArray();
if (!xElements.Any())
return true; // 没有子节点也是有效的
List<BehaviorTreeDef> children = new();
foreach (var node in xElements)
{

View File

@ -1,6 +1,6 @@
namespace Data
{
public class BulletDef:EntityDef
public class BulletDef : EntityDef
{
public string className;
public string value;

View File

@ -1,10 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using UnityEngine;
namespace Data
{
public class CharacterDef : EntityDef

View File

@ -1,7 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Xml.Linq;

View File

@ -1,3 +1,4 @@
using Configs;
using System;
using System.Collections;
using System.Collections.Generic;
@ -5,9 +6,7 @@ using System.Linq;
using System.Reflection;
using System.Text;
using System.Xml.Linq;
using Configs;
using UnityEngine;
using Object = System.Object;
namespace Data
{

View File

@ -43,7 +43,7 @@ namespace Data
public DrawNodeDef rangedAttack_up;
public DrawNodeDef rangedAttack_left;
public DrawNodeDef rangedAttack_right;
public DrawNodeDef GetDrawNodeDef(EntityState state, Orientation orientation,
out Orientation? fallbackOrientation)
{
@ -237,7 +237,7 @@ namespace Data
{
base.Init(xmlDef);
nodeName = xmlDef.Attribute("name")?.Value??"noName";
nodeName = xmlDef.Attribute("name")?.Value ?? "noName";
position = StringToVector(xmlDef.Attribute("position")?.Value ?? "(0 0)");
FPS = float.TryParse(xmlDef.Attribute("FPS")?.Value, out var result) ? result : 1.0f;
return false;

View File

@ -1,8 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
namespace Data
{
public class EntityDef : Define

View File

@ -46,5 +46,5 @@ namespace Data
}
}

View File

@ -1,6 +1,6 @@
namespace Data
{
public class MonsterDef:EntityDef
public class MonsterDef : EntityDef
{
public WeaponDef weapon;
}