DeckStacker v1.0
A card manager plugin for Unity games.
 
Loading...
Searching...
No Matches
DeckStacker.DSCard Class Reference
Inheritance diagram for DeckStacker.DSCard:

Public Member Functions

bool GrabPositionIsReset ()
 
string UpdateCardID (string name="")
 
void SetCardPool (DSCardPool settingCardPool_)
 
void ReturnCardToPool ()
 
DSCard[] GetCardNeighbors ()
 
void ResetCard ()
 
void DestroyCard ()
 

Static Public Member Functions

static void CardNullCheck (ref DSCard cardRef_, MonoBehaviour theMono_)
 

Properties

DSCardArt cardArt [get]
 
DSCardData cardData [get]
 
DSCardFader cardFader [get]
 
DSCardFlipper cardFlipper [get]
 
DSCardGrabber cardGrabber [get]
 
string cardID [get, set]
 
DSCardInput cardInput [get]
 
DSCardMovementHelper cardMoveHelper [get]
 
DSCardSelector cardSelector [get]
 
DSCardTintHelper cardTintHelper [get]
 
RectTransform rTransform [get]
 
DSStack stack [get, set]
 
DSCardPool cardPool [get, set]
 
bool isOffset [get, set]
 
bool isRotated [get]
 
bool isGrabbed [get]
 
int stackIndex [get]
 
DSCardSpacing cardSpacing [get]
 

Detailed Description

This script serves as a hub for the various components of a DeckStacker card to communicate data between eachother.

Should be attached to a card prefab.

Member Function Documentation

◆ CardNullCheck()

static void DeckStacker.DSCard.CardNullCheck ( ref DSCard cardRef_,
MonoBehaviour theMono_ )
inlinestatic

Used in Awake calls for DeckStacker Monobehaviours attached to the card, to make sure all of them are referencing this script.

◆ DestroyCard()

void DeckStacker.DSCard.DestroyCard ( )
inline

If you don't want to return a card to the card pool (for whatever reason) and have to remove it from the table: This method will destroy this GameObject and clean up the cards references in DeckStacker.

◆ GetCardNeighbors()

DSCard[] DeckStacker.DSCard.GetCardNeighbors ( )
inline

Gets a DSStack array containing neighboring cards in the card's current stack. This will only return up to 2 cards.

◆ GrabPositionIsReset()

bool DeckStacker.DSCard.GrabPositionIsReset ( )
inline

Returns whether the card's grab parent has been reset back to it's default position.

◆ ResetCard()

void DeckStacker.DSCard.ResetCard ( )
inline

Used in the card pool system to reset a card when going back to the pool.

◆ ReturnCardToPool()

void DeckStacker.DSCard.ReturnCardToPool ( )
inline

Return this card to card pool and cleanup some data.

◆ SetCardPool()

void DeckStacker.DSCard.SetCardPool ( DSCardPool settingCardPool_)
inline

When a card is instantiated, set the card pool to make sure associated data is accessible. This is used when a card pool is initializing new cards.

◆ UpdateCardID()

string DeckStacker.DSCard.UpdateCardID ( string name = "")
inline

This method will give a generic or specified cardID to this card, and append a unique number to the end.\nIt will also return that string.

Property Documentation

◆ cardArt

DSCardArt DeckStacker.DSCard.cardArt
get

Manages and updates card art

◆ cardData

DSCardData DeckStacker.DSCard.cardData
get

References game-specific card data.
Default data is traditional playing card data: suit, rank

◆ cardFader

DSCardFader DeckStacker.DSCard.cardFader
get

This component controls card fading and visibility, through a CanvasGroup.

◆ cardFlipper

DSCardFlipper DeckStacker.DSCard.cardFlipper
get

DSCardFlipper animates card flipping via code

◆ cardGrabber

DSCardGrabber DeckStacker.DSCard.cardGrabber
get

Controls card "grabbing". "Grabbing" is another card offset that is designed to react to player input (like a mouse drag).

◆ cardID

string DeckStacker.DSCard.cardID
getset

A non-unique identifier for the card. The default DSCardArt script uses this to select art to use.

◆ cardInput

DSCardInput DeckStacker.DSCard.cardInput
get

Used to handle card input, buttons, etc

◆ cardMoveHelper

DSCardMovementHelper DeckStacker.DSCard.cardMoveHelper
get

A helper component that communicates with the DSCardMover code to update card movement.
DSCardMovementHelper helps out with base card movement and offset movement (like for selection behavior).

◆ cardPool

DSCardPool DeckStacker.DSCard.cardPool
getset

Records which card pool spawned this card.

◆ cardSelector

DSCardSelector DeckStacker.DSCard.cardSelector
get

Used to manage whether a card is "selected" by the DeckStacker system.
Card selection is a base feature of just about any game design.

◆ cardSpacing

DSCardSpacing DeckStacker.DSCard.cardSpacing
get

Fetches the card spacing settings from the card pool that spawned this card.

◆ cardTintHelper

DSCardTintHelper DeckStacker.DSCard.cardTintHelper
get

This will provide color tint data to the DSCardTintManager, so you can add a color to a card for whatever UX purpose.

◆ isGrabbed

bool DeckStacker.DSCard.isGrabbed
get

A card is recorded as grabbed in the DSCardMover.cardsGrabbed list.

◆ isOffset

bool DeckStacker.DSCard.isOffset
getset

A card is offset when its offsetParent object is not at the local position of (0,0,0) and/or not scaled to (1,1,1).

◆ isRotated

bool DeckStacker.DSCard.isRotated
get

A card is rotated when this transform is not at a local rotation of (0,0,0).

◆ rTransform

RectTransform DeckStacker.DSCard.rTransform
get

Used to avoid a GetComponent call for card sizing

◆ stack

DSStack DeckStacker.DSCard.stack
getset

A cached value to avoid less efficient ways of finding what stack a card belongs to.
Note: The DeckStacker system assumes that all non-pooled cards should be part of a stack.
If you want a card to float around a table without being forced into typical stack organization, consider using an Undefined stack.

◆ stackIndex

int DeckStacker.DSCard.stackIndex
get

Fetches the card's index in its stack.cards list. This will also be the sibling index of the transform.


The documentation for this class was generated from the following file: