[Add] Dice & Refactor private names
This commit is contained in:
@@ -14,7 +14,7 @@ namespace YachtDice.Inventory
|
||||
[SerializeField] private TMP_Text slotCountText;
|
||||
[SerializeField] private Button closeButton;
|
||||
|
||||
private readonly List<InventorySlotView> spawnedSlots = new();
|
||||
private readonly List<InventorySlotView> _spawnedSlots = new();
|
||||
|
||||
public event Action<ModifierInstance> OnActivateClicked;
|
||||
public event Action<ModifierInstance> OnDeactivateClicked;
|
||||
@@ -52,7 +52,7 @@ namespace YachtDice.Inventory
|
||||
slot.OnActivateClicked += HandleActivate;
|
||||
slot.OnDeactivateClicked += HandleDeactivate;
|
||||
slot.OnSellClicked += HandleSell;
|
||||
spawnedSlots.Add(slot);
|
||||
_spawnedSlots.Add(slot);
|
||||
}
|
||||
|
||||
if (slotCountText != null)
|
||||
@@ -61,14 +61,14 @@ namespace YachtDice.Inventory
|
||||
|
||||
private void ClearSlots()
|
||||
{
|
||||
for (int i = 0; i < spawnedSlots.Count; i++)
|
||||
for (int i = 0; i < _spawnedSlots.Count; i++)
|
||||
{
|
||||
spawnedSlots[i].OnActivateClicked -= HandleActivate;
|
||||
spawnedSlots[i].OnDeactivateClicked -= HandleDeactivate;
|
||||
spawnedSlots[i].OnSellClicked -= HandleSell;
|
||||
Destroy(spawnedSlots[i].gameObject);
|
||||
_spawnedSlots[i].OnActivateClicked -= HandleActivate;
|
||||
_spawnedSlots[i].OnDeactivateClicked -= HandleDeactivate;
|
||||
_spawnedSlots[i].OnSellClicked -= HandleSell;
|
||||
Destroy(_spawnedSlots[i].gameObject);
|
||||
}
|
||||
spawnedSlots.Clear();
|
||||
_spawnedSlots.Clear();
|
||||
}
|
||||
|
||||
private void HandleActivate(ModifierInstance inst) => OnActivateClicked?.Invoke(inst);
|
||||
|
||||
Reference in New Issue
Block a user