Single Player CCG Kit Manual

From gamevanilla wiki
Revision as of 01:34, 11 February 2020 by David (Talk | contribs) (How to add a player character)

Jump to: navigation, search

How Addressables work in a nutshell

Single-Player CCG Kit uses the Addressable Asset System for dynamically loading its resources. We recommend going over the package documentation to understand the reasoning and benefits of using this system, as opposed to classic Unity systems like the Resources folder.

The kit currently provides two Addressable assets:

  • Wizard (for the player character).
  • Demon (for the enemy character).

As more card effects are developed in future updates, we will provide additional characters with different abilities/AI patterns.

These assets are located in the GameData folder and the Players and Enemies subfolders, respectively.

In order to mark an asset as Addressable, you just need to toggle the Addressable option in the asset's Inspector and provide a name for it. Addressable assets will automatically be added to the Addressable's Default Local Group, so they can be easily accessible by default. Addressable initialization happens in the GameBootstrap script and is done by reference (with the referenced addressable assets being specified in the GameBootstrap's Inspector).

How to add a player character

We start by creating an empty game object in our scene to hold our player character.


We name the object for our player; in this example, the name is FallenHero. Inside this empty game object we drag our rigged sprite.


We click the Edit Collider button on the Box Collider 2D component to adjust the collider to surround our image correctly.



With our player looking correct, we need to add the appropriate scripts for our player to function. We add the Convert to Entity, Entity Cache and Player Authoring components. For the Convert to Entity component, make sure it is set to Convert And Inject Game Object.


Now that we have the player set up, we can make a prefab by simply dragging it into SinglePlayerCCGKit/Prefabs/Characters.


Next, we need to create a collection of cards for our player. We want to create the card library in SinglePlayerCCGKit/GameData/Collections. We do this by right-clicking in the Project window and choosing Create/Single-Player CCG Kit/Card Library. We name it after our player.



Now we need to fill the deck with some base cards. For this example we are just adding the existing cards.


Now that we have our prefab and a deck, we need to create the character template. We want to create the template in SinglePlayerCCGKit/GameData/Players. We do this by right-clicking in the Project window and choosing Create/Single-Player CCG Kit/Player. We again name it after our player.



Now we can use the editor to fill in our character template's data. Choose the FallenHero template as the asset. Choose the FallenHero prefab for the prefab. Choose the FallenHeroDeck for the deck. And lastly add new actions as you wish.


At this point, you have a complete player that you can now enter into the Character Template field of the Game Bootstrap component of the Game scene. It will now be active in the game!