(client) feat:健康给予,路径优化,结算界面,商店界面 (#60)

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/60
This commit is contained in:
2025-10-10 14:08:23 +08:00
parent 9a797479ff
commit 16b49f3d3a
1900 changed files with 114053 additions and 34157 deletions

View File

@@ -1,8 +1,7 @@
using System;
using Base;
using Data;
using TMPro;
using UnityEngine;
using Utils;
namespace Entity
{
@@ -14,7 +13,22 @@ namespace Entity
public TMP_Text tip;
public bool PlayerOnGround { get; private set; }
override public void Init()
private void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.CompareTag("Player"))
{
tip.gameObject.SetActive(true);
PlayerOnGround = true;
}
}
private void OnTriggerExit2D(Collider2D other)
{
tip.gameObject.SetActive(false);
PlayerOnGround = false;
}
public override void Init()
{
var textureSize = GetBodyTextureSize();
outlineRenderer.size = textureSize;
@@ -36,28 +50,13 @@ namespace Entity
trigger.radius = buildingDef.detectionRadius;
if (!string.IsNullOrEmpty(buildingDef.triggerPosition))
{
var position = Utils.StringUtils.StringToVector2(buildingDef.triggerPosition);
var position = StringUtils.StringToVector2(buildingDef.triggerPosition);
trigger.offset = position;
}
// tip.transform.localPosition += new Vector3(0f, textureSize.y * 2 / 3, 0f);
tip.text = $"按{buildingDef.activateKey}打开{buildingDef.label}\n{buildingDef.description}";
tip.gameObject.SetActive(false);
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.CompareTag("Player"))
{
tip.gameObject.SetActive(true);
PlayerOnGround = true;
}
}
private void OnTriggerExit2D(Collider2D other)
{
tip.gameObject.SetActive(false);
PlayerOnGround = false;
}
}
}