Difference between revisions of "Single Player CCG Kit Manual"
(→How to add a player character)
(→How to add a player character)
|Line 23:||Line 23:|
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 name the object for our player, in this example the name is ''FallenHero''. Inside this empty game object we drag our rigged sprite.
Revision as of 00:36, 11 February 2020
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:
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 need to add Convert to Entity, Entity Cache and Player Authoring. 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 folder and choosing Create> Single-Player CCG Kit> Card Library. We label it after our player.
Now we need to fill the deck with some base cards. For this example we’re 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 Character Template in “SinglePlayerCCGKit>GameData>Players”. We do this by right clicking in the folder and choosing Create> Single-Player CCG Kit>Player. We again label it after our player.
Now we can use the editor to fill in our Character Template. Choose the FallenHero Player Data as the asset. Choose our FallenHero Prefab for the prefab. Choose our FallenHeroDeck for the deck. And lastly add 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. It will now be active in the game!