Class ShopManager
Manages the items displayed in the store, and is in charge of buying and selling them for currency.
Namespace: AutoBattleFramework.Shop
Assembly: cs.temp.dll.dll
Syntax
public class ShopManager : MonoBehaviour
Fields
BuyExpCost
Amount of currency to add experience to the CurrentExp.
Declaration
public int BuyExpCost
Field Value
Type | Description |
---|---|
Int32 |
currency
Declaration
public int currency
Field Value
Type | Description |
---|---|
Int32 |
ExpToAdd
Amount of experience bought and to be add to CurrentExp.
Declaration
public int ExpToAdd
Field Value
Type | Description |
---|---|
Int32 |
GameActorsModified
Declaration
public Transform GameActorsModified
Field Value
Type | Description |
---|---|
Transform |
GameActorsModifiedBackupStage
"Transform where the backup of modified GameActors will be placed. Place far from the main game."
Declaration
public Transform GameActorsModifiedBackupStage
Field Value
Type | Description |
---|---|
Transform |
GameActorsModifiedBackupState
"Transform where the backup of modified GameActors will be placed. Place far from the main game."
Declaration
public Transform GameActorsModifiedBackupState
Field Value
Type | Description |
---|---|
Transform |
numberOfItems
Number of ShopItemInfo displayed in shopUI.
Declaration
public int numberOfItems
Field Value
Type | Description |
---|---|
Int32 |
RefreshCost
Amount of currency to extract new items from the list.
Declaration
public int RefreshCost
Field Value
Type | Description |
---|---|
Int32 |
RemoveFromListWhenBought
When purchasing items, remove them from the list.
Declaration
public bool RemoveFromListWhenBought
Field Value
Type | Description |
---|---|
Boolean |
RepeatItems
When extracting items from a IShopList, show repeated items.
Declaration
public bool RepeatItems
Field Value
Type | Description |
---|---|
Boolean |
shopLevelManager
Declaration
public ShopLevelManager shopLevelManager
Field Value
Type | Description |
---|---|
ShopLevelManager |
shopUI
Declaration
public ShopUI shopUI
Field Value
Type | Description |
---|---|
ShopUI |
showList
Declaration
public List<ShopItemInfo> showList
Field Value
Type | Description |
---|---|
List<ShopItemInfo> |
Methods
BuyExp()
Substracts the BuyExpCost from currency and adds ExpToAdd to the CurrentExp.
Declaration
public void BuyExp()
EditGameCharacterFromAllLists(GameCharacter, StatModificator)
Edit a stat in runtime. Useful to create effects like "From now on X character purchased through the store has 1000 life", or similar.
Declaration
public GameCharacter EditGameCharacterFromAllLists(GameCharacter gameCharacter, StatModificator modificator)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | gameCharacter | Character to edit |
StatModificator | modificator | Stat to edit. The value needs to be fixed. |
Returns
Type | Description |
---|---|
GameCharacter |
GetRandomItems()
Gets a random number of ShopItemInfo from the IShopList associated with the CurrentLevel based on the value of numberOfItems. Creates all the ShopItemUI of the extracted items, allowing them to be purchased.
Declaration
public void GetRandomItems()
Refresh()
Subtracts the RefreshCost from currency and retrieves a new set of items (see GetRandomItems()).
Declaration
public void Refresh()
RemoveShopItemFromAllLists(ShopItemInfo)
Remove a shop item from all list.
Declaration
public void RemoveShopItemFromAllLists(ShopItemInfo info)
Parameters
Type | Name | Description |
---|---|---|
ShopItemInfo | info | Item to remove |
RestoreGameCharacterBackupForAllLists(GameCharacter, Transform)
Restore a character backup who has been edited in all list.
Declaration
public GameCharacter RestoreGameCharacterBackupForAllLists(GameCharacter gameCharacter, Transform backupParent)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | gameCharacter | Character to edit |
Transform | backupParent |
Returns
Type | Description |
---|---|
GameCharacter |
RestoreShopItemForAllLists(ScriptableShopItem)
Restore a shop item that has been removed.
Declaration
public void RestoreShopItemForAllLists(ScriptableShopItem info)
Parameters
Type | Name | Description |
---|---|---|
ScriptableShopItem | info | Item to restore. |