(client) feat:添加行为树和工作类

This commit is contained in:
m0_75251201
2025-07-20 20:41:37 +08:00
parent 9dcc67d710
commit a48ccca5f4
12 changed files with 350 additions and 44 deletions

View File

@ -1,3 +1,4 @@
using Prefab;
using UnityEngine;
namespace Managers
@ -5,11 +6,17 @@ namespace Managers
public class Generator:MonoBehaviour
{
public GameObject entityLevel;
public EntityPrefab entityPrefab;
public void GenerateEntity(Data.PawnDef pawnDef, Vector3 pos)
{
if (entityPrefab == null || pawnDef == null)
return;
GameObject entity = Instantiate(entityPrefab.gameObject, pos, Quaternion.identity, entityLevel.transform);
// entity.name = pawnDef.name;
var entityComponent = entity.GetComponent<EntityPrefab>();
entityComponent?.Init(pawnDef);
}
}
}