|
|
|
@ -63,26 +63,26 @@ public abstract class ViewItemContainer : MonoBehaviour, IItemContainer, IShopMo |
|
|
|
protected abstract void OnInitialize(Item item, ShopModel owner = null); |
|
|
|
|
|
|
|
// When the observable fires, check if we're the view corresponding to the selected item. Select if we are!
|
|
|
|
public void OnSelected(Item item) |
|
|
|
public virtual void OnSelected(Item item) |
|
|
|
{ |
|
|
|
IsSelected = this.item == item; |
|
|
|
} |
|
|
|
|
|
|
|
public void OnRemoved(Item item) |
|
|
|
public virtual void OnRemoved(Item item) |
|
|
|
{ |
|
|
|
if (item != Item) return; // Well we only want this if the item removed from the model is actually ours!
|
|
|
|
IsSelected = false; // Kind of pointless, but won't hurt
|
|
|
|
Destroy(gameObject); |
|
|
|
} |
|
|
|
|
|
|
|
public void OnAdded(Item item) |
|
|
|
public virtual void OnAdded(Item item) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
|
|
|
|
public void OnTransaction(int cost) |
|
|
|
public virtual void OnTransaction(int cost) |
|
|
|
{ |
|
|
|
//throw new NotImplementedException(); Irrelevant for the view containers
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// The reason we do this in OnDestroy() is so we don't have a memory leak when this gets removed externally somehow
|
|
|
|
|