mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 05:27:13 +08:00
(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:
@@ -1,45 +1,37 @@
|
||||
using Base;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using Utils;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
|
||||
public delegate void NonReturnCallback();
|
||||
|
||||
public class EntityPlacementUI : UIBase, ITickUI
|
||||
{
|
||||
public TMP_Text promptText;
|
||||
|
||||
public NonReturnCallback currentAction;
|
||||
|
||||
public GameObject focusBox;
|
||||
public bool snapEnabled = false;
|
||||
public bool snapEnabled;
|
||||
|
||||
public NonReturnCallback currentAction;
|
||||
|
||||
public string Prompt
|
||||
{
|
||||
get => promptText.text;
|
||||
set => promptText.text = value;
|
||||
}
|
||||
|
||||
public void TickUI()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
Base.UIInputControl.Instance.Hide(this);
|
||||
}
|
||||
if (currentAction != null && Input.GetMouseButtonDown(0))
|
||||
{
|
||||
currentAction();
|
||||
}
|
||||
if (Input.GetKeyDown(KeyCode.Escape)) UIInputControl.Instance.Hide(this);
|
||||
if (currentAction != null && Input.GetMouseButtonDown(0)) currentAction();
|
||||
|
||||
if (!focusBox) return;
|
||||
if (snapEnabled)
|
||||
{
|
||||
focusBox.transform.position = Utils.MousePosition.GetSnappedWorldPosition();
|
||||
}
|
||||
focusBox.transform.position = MousePosition.GetSnappedWorldPosition();
|
||||
else
|
||||
{
|
||||
focusBox.transform.position = Utils.MousePosition.GetWorldPosition();
|
||||
}
|
||||
|
||||
focusBox.transform.position = MousePosition.GetWorldPosition();
|
||||
}
|
||||
|
||||
public override void Show()
|
||||
|
||||
Reference in New Issue
Block a user