using System.Collections.Generic; using UnityEngine; public class PlayerEntity : Entity { public bool hasMoved = false; public bool hasAttacked = false; private List moveableTiles = new(); [SerializeField] private Weapon[] weapons; private List 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 void Update() { } public void SkipTurn() { 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); } } }