finally get pathfinding done?
This commit is contained in:
parent
7b151c1a53
commit
7bd61df481
23 changed files with 1408 additions and 785 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ActionUIHandler : MonoBehaviour
|
||||
{
|
||||
|
|
@ -17,14 +18,28 @@ public class ActionUIHandler : MonoBehaviour
|
|||
}
|
||||
|
||||
#endregion
|
||||
private PlayerEntity selectedEntity;
|
||||
private RangedWeapon possibleRanged;
|
||||
[Header("UI")]
|
||||
[SerializeField] private Vector3 offset;
|
||||
[SerializeField] private GameObject actionUI;
|
||||
private Entity selectedEntity;
|
||||
public void ShowUI(Entity target)
|
||||
[SerializeField] private Button attackButton;
|
||||
[SerializeField] private Button reloadButton;
|
||||
|
||||
public void ShowUI(PlayerEntity target)
|
||||
{
|
||||
possibleRanged = null;
|
||||
selectedEntity = target;
|
||||
transform.position = Input.mousePosition + offset;
|
||||
if (target.currentWeapon.TryGetComponent(out RangedWeapon isRanged))
|
||||
{
|
||||
possibleRanged = isRanged;
|
||||
reloadButton.gameObject.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
reloadButton.gameObject.SetActive(false);
|
||||
}
|
||||
actionUI.SetActive(true);
|
||||
}
|
||||
public void HideUI()
|
||||
|
|
@ -32,6 +47,20 @@ public class ActionUIHandler : MonoBehaviour
|
|||
actionUI.SetActive(false);
|
||||
}
|
||||
|
||||
public void ReloadGun()
|
||||
{
|
||||
possibleRanged.Reload();
|
||||
}
|
||||
|
||||
public void Attack()
|
||||
{
|
||||
selectedEntity.Attack();
|
||||
}
|
||||
|
||||
public void SkipTurn()
|
||||
{
|
||||
selectedEntity.SkipTurn();
|
||||
}
|
||||
public void MoveEntity()
|
||||
{
|
||||
HideUI();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue