finally get pathfinding done?
This commit is contained in:
parent
7b151c1a53
commit
7bd61df481
23 changed files with 1408 additions and 785 deletions
|
|
@ -6,9 +6,19 @@ public class PlayerEntity : Entity
|
|||
public bool hasMoved = false;
|
||||
public bool hasAttacked = false;
|
||||
private List<TileObject> moveableTiles = new();
|
||||
[SerializeField] private Weapon[] weapons;
|
||||
private List<Weapon> weaponInstances = new();
|
||||
public Weapon currentWeapon;
|
||||
void Start()
|
||||
{
|
||||
|
||||
foreach (Weapon weapon in weapons)
|
||||
{
|
||||
Weapon newWeapon = Instantiate(weapon, transform);
|
||||
newWeapon.thisEntity = this;
|
||||
newWeapon.tag = tag;
|
||||
weaponInstances.Add(newWeapon);
|
||||
}
|
||||
currentWeapon = weaponInstances[0];
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
|
|
@ -22,13 +32,21 @@ public class PlayerEntity : Entity
|
|||
hasMoved = true;
|
||||
hasAttacked = true;
|
||||
TurnHandler.instance.UpdateTurns();
|
||||
}
|
||||
public void Attack()
|
||||
{
|
||||
currentWeapon.TryAttack();
|
||||
}
|
||||
|
||||
public void SwitchWeapon()
|
||||
{
|
||||
|
||||
}
|
||||
private void OnMouseDown()
|
||||
{
|
||||
if ((!hasMoved) && !PlayerEntityMovement.instance.isMoving)
|
||||
{
|
||||
ActionUIHandler.instance.ShowUI(this);
|
||||
SkipTurn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue