mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 11:27:14 +08:00
(client) feat:支持定义实体的碰撞体大小和偏移;建筑支持定义实体建筑和瓦片建筑,建筑支持指定按钮回调;添加存档管理器;Dev支持设置是否暂停;实体允许定义事件组;添加基地界面 (#57)
Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com> Reviewed-on: http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite/pulls/57
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
using Data;
|
||||
using Managers;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
{
|
||||
public class Building : CombatantEntity
|
||||
{
|
||||
private BuildingOutline buildingOutline;
|
||||
private BuildingDef buildingDef;
|
||||
|
||||
public override void Init(EntityDef entityDef)
|
||||
{
|
||||
base.Init(entityDef);
|
||||
buildingDef = entityDef as BuildingDef;
|
||||
buildingOutline = entityPrefab.outline as BuildingOutline;
|
||||
}
|
||||
|
||||
public override void SetTarget(Vector3 pos)
|
||||
{
|
||||
}
|
||||
@@ -34,5 +46,18 @@ namespace Entity
|
||||
transform.position += Vector3.right;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Tick()
|
||||
{
|
||||
base.Tick();
|
||||
if (buildingDef.triggerEvents != null && buildingOutline.PlayerOnGround &&
|
||||
Input.GetKeyDown(buildingDef.activateKey))
|
||||
{
|
||||
foreach (var eventDef in buildingDef.triggerEvents)
|
||||
{
|
||||
EventManager.Instance.Action(eventDef, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user