[Add] Dice & Refactor private names
This commit is contained in:
@@ -22,7 +22,7 @@ namespace YachtDice.Inventory
|
||||
[SerializeField] private Color activeColor = new(0.7f, 1f, 0.7f);
|
||||
[SerializeField] private Color inactiveColor = Color.white;
|
||||
|
||||
private ModifierInstance instance;
|
||||
private ModifierInstance _instance;
|
||||
|
||||
public event Action<ModifierInstance> OnActivateClicked;
|
||||
public event Action<ModifierInstance> OnDeactivateClicked;
|
||||
@@ -31,17 +31,17 @@ namespace YachtDice.Inventory
|
||||
private void Awake()
|
||||
{
|
||||
if (activateButton != null)
|
||||
activateButton.onClick.AddListener(() => OnActivateClicked?.Invoke(instance));
|
||||
activateButton.onClick.AddListener(() => OnActivateClicked?.Invoke(_instance));
|
||||
if (deactivateButton != null)
|
||||
deactivateButton.onClick.AddListener(() => OnDeactivateClicked?.Invoke(instance));
|
||||
deactivateButton.onClick.AddListener(() => OnDeactivateClicked?.Invoke(_instance));
|
||||
if (sellButton != null)
|
||||
sellButton.onClick.AddListener(() => OnSellClicked?.Invoke(instance));
|
||||
sellButton.onClick.AddListener(() => OnSellClicked?.Invoke(_instance));
|
||||
}
|
||||
|
||||
public void Setup(ModifierInstance modifierInstance, bool canActivateMore)
|
||||
{
|
||||
instance = modifierInstance;
|
||||
var def = instance.Definition;
|
||||
_instance = modifierInstance;
|
||||
var def = _instance.Definition;
|
||||
|
||||
if (def == null) return;
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace YachtDice.Inventory
|
||||
if (def.HasLimitedUses)
|
||||
{
|
||||
usesText.gameObject.SetActive(true);
|
||||
usesText.text = $"{instance.RemainingUses}/{def.MaxUses}";
|
||||
usesText.text = $"{_instance.RemainingUses}/{def.MaxUses}";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -64,7 +64,7 @@ namespace YachtDice.Inventory
|
||||
|
||||
if (sellPriceText != null) sellPriceText.text = def.SellPrice.ToString();
|
||||
|
||||
bool isActive = instance.IsActive;
|
||||
bool isActive = _instance.IsActive;
|
||||
|
||||
if (activateButton != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user