mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 06:57:12 +08:00
(client) feat:添加基地界面到游玩界面的过程,添加存档管理,技能树变得可用 (#58)
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/58
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
using System;
|
||||
using Data;
|
||||
using Item;
|
||||
using Managers;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
{
|
||||
public class Monster:LivingEntity
|
||||
{
|
||||
private WeaponResource weapon;
|
||||
public override void Init(EntityDef entityDef)
|
||||
public override void Init(EntityDef entityDefine)
|
||||
{
|
||||
base.Init(entityDef);
|
||||
var monsterDef = entityDef as MonsterDef;
|
||||
base.Init(entityDefine);
|
||||
var monsterDef = entityDefine as MonsterDef;
|
||||
if (monsterDef != null)
|
||||
{
|
||||
weapon = (WeaponResource)ItemResourceManager.Instance.GetItem(monsterDef.weapon.defName);
|
||||
@@ -21,6 +23,13 @@ namespace Entity
|
||||
{
|
||||
return weapon;
|
||||
}
|
||||
|
||||
private void OnCollisionStay2D(Collision2D other)
|
||||
{
|
||||
if (!other.gameObject.CompareTag("Player")) return;
|
||||
var playerEntity = other.gameObject.GetComponent<Entity>();
|
||||
playerEntity?.OnHit(this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user