[Fix] Limited Use Modifier
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
using UnityEngine;
|
||||
using VContainer;
|
||||
using YachtDice.Categories;
|
||||
using YachtDice.Economy;
|
||||
using YachtDice.Modifiers.Runtime;
|
||||
using YachtDice.Scoring;
|
||||
|
||||
namespace YachtDice.Inventory
|
||||
{
|
||||
@@ -12,16 +10,14 @@ namespace YachtDice.Inventory
|
||||
[SerializeField] private InventoryView inventoryView;
|
||||
|
||||
private InventoryModel _model;
|
||||
private ScoringSystem _scoringSystem;
|
||||
private CurrencyBank _currencyBank;
|
||||
|
||||
public InventoryModel Model => _model;
|
||||
|
||||
[Inject]
|
||||
public void Construct(InventoryModel model, ScoringSystem scoringSystem, CurrencyBank currencyBank)
|
||||
public void Construct(InventoryModel model, CurrencyBank currencyBank)
|
||||
{
|
||||
this._model = model;
|
||||
this._scoringSystem = scoringSystem;
|
||||
this._currencyBank = currencyBank;
|
||||
}
|
||||
|
||||
@@ -32,7 +28,6 @@ namespace YachtDice.Inventory
|
||||
inventoryView.OnSellClicked += HandleSell;
|
||||
|
||||
_model.OnInventoryChanged += HandleInventoryChanged;
|
||||
_scoringSystem.OnCategoryConfirmed += HandleCategoryConfirmed;
|
||||
|
||||
RefreshView();
|
||||
}
|
||||
@@ -48,9 +43,6 @@ namespace YachtDice.Inventory
|
||||
|
||||
if (_model != null)
|
||||
_model.OnInventoryChanged -= HandleInventoryChanged;
|
||||
|
||||
if (_scoringSystem != null)
|
||||
_scoringSystem.OnCategoryConfirmed -= HandleCategoryConfirmed;
|
||||
}
|
||||
|
||||
public void ToggleVisibility()
|
||||
@@ -89,11 +81,6 @@ namespace YachtDice.Inventory
|
||||
RefreshView();
|
||||
}
|
||||
|
||||
private void HandleCategoryConfirmed(CategoryDefinition category, ScoreResult result)
|
||||
{
|
||||
_model.ConsumeUseOnActive();
|
||||
}
|
||||
|
||||
private void RefreshView()
|
||||
{
|
||||
if (inventoryView != null && _model != null)
|
||||
|
||||
Reference in New Issue
Block a user