yeah i think that's commit worthy
This commit is contained in:
parent
49cf2f2bb9
commit
fada3af715
16 changed files with 658 additions and 29 deletions
|
|
@ -32,6 +32,7 @@ public class ActionUIHandler : MonoBehaviour
|
|||
[SerializeField] private TextMeshProUGUI nameLabel;
|
||||
[SerializeField] private TextMeshProUGUI classLabel;
|
||||
[SerializeField] private Image unitPortrait;
|
||||
[SerializeField] private TextMeshProUGUI weaponLabel;
|
||||
[SerializeField] private TextMeshProUGUI attackLabel;
|
||||
[SerializeField] private TextMeshProUGUI speedLabel;
|
||||
[SerializeField] private Transform healthBar;
|
||||
|
|
@ -41,6 +42,7 @@ public class ActionUIHandler : MonoBehaviour
|
|||
[SerializeField] private Button attackButton;
|
||||
[SerializeField] private Button reloadButton;
|
||||
[SerializeField] private Button switchButton;
|
||||
[SerializeField] private Button officerAbilityButton;
|
||||
|
||||
[Header("Weapon Switcher")]
|
||||
[SerializeField] private RectTransform weaponUIPanel;
|
||||
|
|
@ -54,6 +56,7 @@ public class ActionUIHandler : MonoBehaviour
|
|||
opened = true;
|
||||
possibleRanged = null;
|
||||
selectedEntity = target;
|
||||
|
||||
actionUI.SetActive(true);
|
||||
actionText.gameObject.SetActive(true);
|
||||
infoUI.SetActive(true);
|
||||
|
|
@ -74,17 +77,22 @@ public class ActionUIHandler : MonoBehaviour
|
|||
else
|
||||
{
|
||||
attackButton.gameObject.SetActive(false);
|
||||
if (isRanged && isRanged.fired)
|
||||
if (isRanged && isRanged.fired && selectedEntity.actions >= isRanged.reloadActionUsage)
|
||||
{
|
||||
if (selectedEntity.actions < 2)
|
||||
{
|
||||
reloadButton.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
reloadButton.gameObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
reloadButton.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
officerAbilityButton.gameObject.SetActive(false);
|
||||
if (selectedEntity.officerInstance)
|
||||
{
|
||||
officerAbilityButton.gameObject.SetActive(true);
|
||||
}
|
||||
moveButton.gameObject.SetActive(true);
|
||||
switchButton.gameObject.SetActive(true);
|
||||
|
|
@ -99,6 +107,8 @@ public class ActionUIHandler : MonoBehaviour
|
|||
public void UpdateInfo()
|
||||
{
|
||||
healthBar.localScale = new Vector3(selectedEntity.health / selectedEntity.maxHealth,1,1);
|
||||
classLabel.text = selectedEntity.selectedClass.ToString();
|
||||
weaponLabel.text = $"Weapon: {selectedEntity.currentWeapon.weaponName}";
|
||||
healthText.text = $"{selectedEntity.health}/{selectedEntity.maxHealth}";
|
||||
attackLabel.text = $"Attack: {selectedEntity.currentWeapon.damage}";
|
||||
speedLabel.text = $"Speed: {selectedEntity.maxMovement}";
|
||||
|
|
@ -117,7 +127,7 @@ public class ActionUIHandler : MonoBehaviour
|
|||
{
|
||||
possibleRanged.Reload();
|
||||
UpdateActions(possibleRanged.reloadActionUsage);
|
||||
HideUI();
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public void Attack()
|
||||
|
|
@ -127,6 +137,10 @@ public class ActionUIHandler : MonoBehaviour
|
|||
HideUI();
|
||||
}
|
||||
|
||||
public void ActivateOfficer()
|
||||
{
|
||||
selectedEntity.officerInstance.ActivateAbility();
|
||||
}
|
||||
public void SkipTurn()
|
||||
{
|
||||
selectedEntity.SkipTurn();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue