added endscreen
This commit is contained in:
1 parent
a33eb50ca0
commit
2b01c50795
15 files changed
+989
-88
No files matched your search
@@ -7,10 +7,10 @@ namespace Code.Gameplay.Character.Inventory
|
||||
{
|
||||
public class WeaponInventory : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private List<WeaponBase> weapons = new List<WeaponBase>();
|
||||
[SerializeField] private List<WeaponBase> weapons = new();
|
||||
[SerializeField] private Transform weaponHolder;
|
||||
|
||||
[SerializeField] private int currentWeaponIndex = 0;
|
||||
[SerializeField] private int currentWeaponIndex;
|
||||
|
||||
public event Action<WeaponBase> OnWeaponSwitched;
|
||||
public event Action OnWeaponsInitialized;
|
||||
@@ -54,13 +54,13 @@ namespace Code.Gameplay.Character.Inventory
|
||||
|
||||
public void NextWeapon()
|
||||
{
|
||||
int nextIndex = (currentWeaponIndex + 1) % weapons.Count;
|
||||
var nextIndex = (currentWeaponIndex + 1) % weapons.Count;
|
||||
SwitchWeapon(nextIndex);
|
||||
}
|
||||
|
||||
public void PreviousWeapon()
|
||||
{
|
||||
int prevIndex = (currentWeaponIndex - 1 + weapons.Count) % weapons.Count;
|
||||
var prevIndex = (currentWeaponIndex - 1 + weapons.Count) % weapons.Count;
|
||||
SwitchWeapon(prevIndex);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Code.Gameplay.Character.Inventory
|
||||
{
|
||||
if (weapons.Contains(weapon))
|
||||
{
|
||||
int index = weapons.IndexOf(weapon);
|
||||
var index = weapons.IndexOf(weapon);
|
||||
weapons.Remove(weapon);
|
||||
Destroy(weapon.gameObject);
|
||||
|
||||
|
||||
Reference in new issue
Block a user