Class GameItem
Game item that can be attached to GameCharacter when dragged over it.
Inherited Members
Namespace: AutoBattleFramework.BattleBehaviour.GameActors
Assembly: cs.temp.dll.dll
Syntax
public class GameItem : GameActor
Fields
itemModificator
The stats modifiers that will be applied when equipping the character with this item.
Declaration
public ItemModificator itemModificator
Field Value
Type | Description |
---|---|
ItemModificator |
Methods
AddItemModificator(GameCharacter)
Adds the item's itemModificator to the character's itemModificators.
Declaration
public virtual void AddItemModificator(GameCharacter character)
Parameters
Type | Name | Description |
---|---|---|
GameCharacter | character | Character to be equipped with the item |
AfterBought()
The items does nothing after being bought
Declaration
public override void AfterBought()
Overrides
Buy(GameActor)
When the object is purchased, it is created in an empty slot in the ItemBenches.
Declaration
public override GameActor Buy(GameActor shopItem)
Parameters
Type | Name | Description |
---|---|---|
GameActor | shopItem | This item. |
Returns
Type | Description |
---|---|
GameActor | Bough item in the ItemBenches. |
Overrides
CancelDrag()
Cancels the dragging of the item.
Declaration
public void CancelDrag()
MoveGameItemTo(GridCell)
Forces the movement of an item to a cell.
Declaration
protected void MoveGameItemTo(GridCell cell)
Parameters
Type | Name | Description |
---|---|---|
GridCell | cell | New cell where the item is located |
OnDragObjectAction()
Allows dragging of items.
Declaration
public override void OnDragObjectAction()
Overrides
OnMouseDownAction()
Start the drag.
Declaration
public override void OnMouseDownAction()
Overrides
OnMouseOverAction()
Diplays the interface describing the item.
Declaration
public override void OnMouseOverAction()
Overrides
OnMouseUpAction()
Allows an item to be equipped to a character, to be moved within the ItemBenches or to exchange its position with that of another item. In Android, if the item is dragged to the same cell, shows the description of the item.
Declaration
public override void OnMouseUpAction()
Overrides
Sell()
Sell the character and gain currency.
Declaration
public override void Sell()
Overrides
SetVariablesOnBuy(GameItem, IPlayer)
Declaration
protected virtual void SetVariablesOnBuy(GameItem item, IPlayer player = null)
Parameters
Type | Name | Description |
---|---|---|
GameItem | item | |
IPlayer | player |
ShowUI(Boolean)
Diplays the itemDescriptionUI describing the item.
Declaration
public override GameObject ShowUI(bool show)
Parameters
Type | Name | Description |
---|---|---|
Boolean | show | Show or hide the UI. |
Returns
Type | Description |
---|---|
GameObject | The gameobject of itemDescriptionUI. |
Overrides
Start()
Declaration
protected virtual void Start()
SwapItemsInCells(GridCell, GridCell)
If an item is dragged to the position where another item is located, they exchange their positions.
Declaration
protected void SwapItemsInCells(GridCell c1, GridCell c2)
Parameters
Type | Name | Description |
---|---|---|
GridCell | c1 | Cell where the first item is located. |
GridCell | c2 | Cell where the second item is located. |
Update()
Declaration
protected virtual void Update()