DeckStacker v1.0
A card manager plugin for Unity games.
 
Loading...
Searching...
No Matches
DeckStacker.DSCardMover Class Reference

Static Public Member Functions

static void RunUpdate ()
 
static void RunLate ()
 
static bool CardsHaveStopped (int cardsInMotionThreshold_=0)
 
static void RemoveFromCardMoverLists (DSCard removeCard_)
 
static void ClearCardMoverLists ()
 
static void ExchangeCards (DSCard firstCard_, DSCard secondCard_)
 

Static Public Attributes

static List< DSCardcardsWaitingToBeDealt = new List<DSCard>()
 
static List< DSCardcardsInMotion = new List<DSCard>()
 
static List< DSCardcardsOffset = new List<DSCard>()
 
static List< DSCardcardsRotating = new List<DSCard>()
 
static List< DSCardcardsScaling = new List<DSCard>()
 
static List< DSCardcardsGrabbed = new List<DSCard>()
 

Properties

static float defaultCardMoveSpd [get]
 
static float cardSpdMod [get, set]
 
static float grabCardSpd [get, set]
 
static float grabCardSpdMod [get, set]
 

Detailed Description

This script manages card movement.
There are 3 basic categories of card movement:

  1. Base movment (from point A to point B)
  2. Offset movement (movement from within a card prefab to communicate emphasis)
  3. Grab movement (movement primarily intended for user directed input)

...and 2 secondary categories of card movement:

  1. Rotation movement (rotating the top Transform of the card prefab)
  2. Scale adjustments (also on the top Transform of the card prefab)

Member Function Documentation

◆ CardsHaveStopped()

static bool DeckStacker.DSCardMover.CardsHaveStopped ( int cardsInMotionThreshold_ = 0)
inlinestatic

Used in a lot of DSAction code, this checks if any cards are in motion.

If you'd like to specify an acceptable amount of cards that are in motion during some check, you can use cardsInMotionThreshold_.

◆ ClearCardMoverLists()

static void DeckStacker.DSCardMover.ClearCardMoverLists ( )
inlinestatic

Used when unloading or clearing a table / level.
This clears all the lists that DSCardMover manages.

◆ ExchangeCards()

static void DeckStacker.DSCardMover.ExchangeCards ( DSCard firstCard_,
DSCard secondCard_ )
inlinestatic

Takes 2 cards and switches their stack positions, triggering restack(s).

◆ RemoveFromCardMoverLists()

static void DeckStacker.DSCardMover.RemoveFromCardMoverLists ( DSCard removeCard_)
inlinestatic

There are times where you'll need to quickly remove a card from the scene (returning it to a card pool, for example).
This method removes a card from the various lists that DSCardMover manages.

◆ RunLate()

static void DeckStacker.DSCardMover.RunLate ( )
inlinestatic

Called in the DSTableRunner LateUpdate loop.
This triggers the UpdateCardPositions() and acts as the LateUpdate loop for this script.

◆ RunUpdate()

static void DeckStacker.DSCardMover.RunUpdate ( )
inlinestatic

Called in the DSTableRunner Update loop.
This triggers the CardQueueManager() and acts as the Update loop for this script.

Field Documentation

◆ cardsGrabbed

List<DSCard> DeckStacker.DSCardMover.cardsGrabbed = new List<DSCard>()
static

These are the cards that will have their grab positions updated each LateUpdate.
Grabbed cards refers to cards that are offset in a more fluid or context specific manner. Example: anchoring a card to the cursor.
The base position of a card will remain stationary as a specified parent in the card's hierarchy is moved according to the grab.

◆ cardsInMotion

List<DSCard> DeckStacker.DSCardMover.cardsInMotion = new List<DSCard>()
static

These are the cards that will have their positions updated each LateUpdate.

◆ cardsOffset

List<DSCard> DeckStacker.DSCardMover.cardsOffset = new List<DSCard>()
static

These are the cards that will have their offsets updated each LateUpdate.

◆ cardsRotating

List<DSCard> DeckStacker.DSCardMover.cardsRotating = new List<DSCard>()
static

These are the cards that will have their rotations updated each LateUpdate.

◆ cardsScaling

List<DSCard> DeckStacker.DSCardMover.cardsScaling = new List<DSCard>()
static

These are the cards that will have their scales updated each LateUpdate.

◆ cardsWaitingToBeDealt

List<DSCard> DeckStacker.DSCardMover.cardsWaitingToBeDealt = new List<DSCard>()
static

Cards that are being moved from one stack to another will be added to this list.
Cards in this list will be gradually added to cardsInMotion after their dealDelay clocks have run out.

Property Documentation

◆ cardSpdMod

float DeckStacker.DSCardMover.cardSpdMod
staticgetset

This will modify the speed of all card base movement and offset movement. This is put in here for dynamic control of card motion, either by developer or giving the player a fastforward option to make the game more snappy.

◆ defaultCardMoveSpd

float DeckStacker.DSCardMover.defaultCardMoveSpd
staticget

A multiplier on the Time.deltaTime clock speed. Default will carry a card from start to finish in 1/3 of a second.

◆ grabCardSpd

float DeckStacker.DSCardMover.grabCardSpd
staticgetset

Controls speed of lerp during grab position updates.

◆ grabCardSpdMod

float DeckStacker.DSCardMover.grabCardSpdMod
staticgetset

Optional global modifier to grab speed. Easier to reset this to 1, rather than caching the _grabCardSpd value.


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