The idea of this project came about when I had to develop a card game using Unity. After a brief research, I realized that there are no card game plugins in the Unity Assets store, at least not for free. So I decided to make a generic plugin that could help some developers make their own card games. You are free to make all the changes you need to design your game.
You can see the Example Scene to have an idea of how the plugin works. I advise to you to use the Data folder because this folder has a lot of usable objects.
If you don't want to start from zero, follow this steps:
To create instances on Editor: Right click on Project Tab/Create/Card Assets/...
- Create a ResourcesManager in a folder called "Resources" (it must have this name);
- Create many cards as you like using the editor;
- Add the cards to the list in you ResourcesManager
- Create a Canvas and put it on your scene
- Put the Main prefab inside the canvas
- Put 2 players prefabs inside the canvas
- Create 2 diferent players using the editor
- Create you deck passing the name of the card you have created to the deck list
- Crete all the logics neededs (Deck, Hand, Field, Cemitery)
- Create the States normal and attacking
- Finish you player
- Go to your 2 players and set their stats
- Go to Main and set the 2 players and the current player
- Run
If you plan to use the scripts and objects I made, you just need to:
- Create a Canvas to your scene
- Add Main prefab
- Add 2 players using the prefab
- Add the players stats to the 2 players
- Set the players reference into the Main script
- Create your cards using the Editor
- Add your cards to the ResourcesManager (Data/Resources)
- Run
Choose how your card is going to behave according to its logic. The logics are diferent if the card is in a diferent position. Ex: field, deck, hand...
Inside the Player script, you'll find those functions. You may change then as you wish to fit into your game logic. If you need more interactions events to your card, just add then at the event trigger component attatched in the card prefab.