(client) feat:实现摄像机跟踪与移动,实现任意位置生成实体,实现更安全的资源加载方式(指定unity内部加载资源) (#42)
Co-authored-by: zzdxxz <2079238449@qq.com> Co-committed-by: zzdxxz <2079238449@qq.com>
This commit is contained in:
7
Client/Assets/Scripts/Data/AffiliationDef.cs
Normal file
7
Client/Assets/Scripts/Data/AffiliationDef.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Data
|
||||
{
|
||||
public class AffiliationDef : Define
|
||||
{
|
||||
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/AffiliationDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/AffiliationDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bdca0abb717148269b84fe8884ebbf02
|
||||
timeCreated: 1754545405
|
@ -1,30 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
public class PawnDef : Define
|
||||
{
|
||||
public AttributesDef attributes;
|
||||
public DrawingOrderDef drawingOrder;
|
||||
|
||||
public BehaviorTreeDef behaviorTree;
|
||||
public string affiliation;
|
||||
|
||||
|
||||
}
|
||||
public class MonsterDef:PawnDef
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class BehaviorTreeDef : Define
|
||||
{
|
||||
public BehaviorTreeDef[] childTree;
|
||||
public string className="Selector";
|
||||
public string condition;
|
||||
public string value;
|
||||
|
||||
|
||||
public override bool Init(XElement xmlDef)
|
||||
@ -33,7 +17,7 @@ namespace Data
|
||||
|
||||
// 从当前节点获取className和condition属性
|
||||
className = xmlDef.Attribute("className")?.Value ?? className;
|
||||
condition = xmlDef.Attribute("condition")?.Value;
|
||||
value = xmlDef.Attribute("value")?.Value;
|
||||
|
||||
var nodes = xmlDef.Elements("Node");
|
||||
if (!nodes.Any())
|
||||
@ -53,8 +37,4 @@ namespace Data
|
||||
}
|
||||
}
|
||||
|
||||
public class AffiliationDef : Define
|
||||
{
|
||||
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/BehaviorTreeDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/BehaviorTreeDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8513d8eee75e4b9f92179e29f88221b3
|
||||
timeCreated: 1754545380
|
7
Client/Assets/Scripts/Data/BuildingDef.cs
Normal file
7
Client/Assets/Scripts/Data/BuildingDef.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Data
|
||||
{
|
||||
public class BuildingDef:PawnDef
|
||||
{
|
||||
public bool IsBlocked = true;
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/BuildingDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/BuildingDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3855e1d8b2ab4cae904771195fa46cc5
|
||||
timeCreated: 1753703020
|
16
Client/Assets/Scripts/Data/CharacterDef.cs
Normal file
16
Client/Assets/Scripts/Data/CharacterDef.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
public class CharacterDef : PawnDef
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Linq;
|
||||
using UnityEditor.ShaderGraph.Internal;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Data
|
||||
@ -21,11 +19,6 @@ namespace Data
|
||||
Image,
|
||||
Animation
|
||||
}
|
||||
|
||||
public class CharacterDef : PawnDef
|
||||
{
|
||||
}
|
||||
|
||||
public class DrawingOrderDef : Define
|
||||
{
|
||||
public DrawNodeDef drawingOrder_down;
|
||||
@ -33,6 +26,7 @@ namespace Data
|
||||
public DrawNodeDef drawingOrder_left;
|
||||
public DrawNodeDef drawingOrder_right;
|
||||
public string texturePath;
|
||||
public int pixelsPerUnit = 16;
|
||||
|
||||
public DrawNodeDef GetDrawingOrder(Orientation orientation)
|
||||
{
|
||||
@ -74,7 +68,7 @@ namespace Data
|
||||
public DrawNodeType drawNodeType = DrawNodeType.Image;
|
||||
public string nodeName;
|
||||
public Vector2 position = new(0, 0);
|
||||
public float FPS = 1;
|
||||
public float FPS = 0.5f;
|
||||
|
||||
public override bool Init(XElement xmlDef)
|
||||
{
|
||||
@ -143,5 +137,4 @@ namespace Data
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
3
Client/Assets/Scripts/Data/DrawingOrderDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/DrawingOrderDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6360fb04b7a9454d9ac6d8f4864ee31f
|
||||
timeCreated: 1754545254
|
@ -1,8 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using UnityEditor.Animations;
|
||||
using UnityEngine.Tilemaps;
|
||||
|
||||
namespace Data
|
||||
{
|
7
Client/Assets/Scripts/Data/MonsterDef.cs
Normal file
7
Client/Assets/Scripts/Data/MonsterDef.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Data
|
||||
{
|
||||
public class MonsterDef:PawnDef
|
||||
{
|
||||
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Data/MonsterDef.cs.meta
Normal file
3
Client/Assets/Scripts/Data/MonsterDef.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eeac50195bd94af4a21039131cdb77d6
|
||||
timeCreated: 1754545363
|
22
Client/Assets/Scripts/Data/PawnDef.cs
Normal file
22
Client/Assets/Scripts/Data/PawnDef.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Data
|
||||
{
|
||||
public class PawnDef : Define
|
||||
{
|
||||
public AttributesDef attributes;
|
||||
public DrawingOrderDef drawingOrder;
|
||||
|
||||
public BehaviorTreeDef behaviorTree;
|
||||
public string affiliation;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user