(client) feat:主要实现实体的行为树和工作类 (#40)
Co-authored-by: zzdxxz <2079238449@qq.com> Co-committed-by: zzdxxz <2079238449@qq.com>
This commit is contained in:
22
Client/Assets/Scripts/Managers/Generator.cs
Normal file
22
Client/Assets/Scripts/Managers/Generator.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using Prefab;
|
||||
using UnityEngine;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/Managers/Generator.cs.meta
Normal file
3
Client/Assets/Scripts/Managers/Generator.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d78f1b5a44344a4a987e308d3b9478cc
|
||||
timeCreated: 1752937967
|
Reference in New Issue
Block a user