entity changes, classes
This commit is contained in:
parent
bda2b88796
commit
8bd4aedcf9
20 changed files with 1917 additions and 27 deletions
|
|
@ -22,6 +22,7 @@ public class ActionUIHandler : MonoBehaviour
|
|||
#endregion
|
||||
private PlayerEntity selectedEntity;
|
||||
private RangedWeapon possibleRanged;
|
||||
public GameObject cursorObject;
|
||||
[Header("Main UI")]
|
||||
[SerializeField] private GameObject actionUI;
|
||||
[SerializeField] private TextMeshProUGUI actionText;
|
||||
|
|
@ -115,13 +116,14 @@ public class ActionUIHandler : MonoBehaviour
|
|||
public void ReloadGun()
|
||||
{
|
||||
possibleRanged.Reload();
|
||||
selectedEntity.actions -= 2;
|
||||
UpdateActions(possibleRanged.reloadActionUsage);
|
||||
HideUI();
|
||||
}
|
||||
|
||||
public void Attack()
|
||||
{
|
||||
selectedEntity.Attack();
|
||||
cursorObject.SetActive(true);
|
||||
HideUI();
|
||||
}
|
||||
|
||||
|
|
@ -167,12 +169,21 @@ public class ActionUIHandler : MonoBehaviour
|
|||
|
||||
public void SelectWeapon(Weapon weaponSelected)
|
||||
{
|
||||
selectedEntity.actions--;
|
||||
UpdateActions(1);
|
||||
selectedEntity.SwitchWeapon(weaponSelected);
|
||||
HideWeaponList();
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public void UpdateActions(int amount)
|
||||
{
|
||||
selectedEntity.actions -= amount;
|
||||
if (selectedEntity.actions == 0)
|
||||
{
|
||||
selectedEntity.debugDoneObject.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void HideWeaponList()
|
||||
{
|
||||
weaponUIPanel.gameObject.SetActive(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue