Unity Card Game 卡牌遊戲製作

20250310.txt

20250309-2.txt

20250317.txt

相關教學 Unity TextMesh Pro 教學 https://www.cg.com.tw/UnityTextMeshPro/

 

 

在 Unity 中使用 二維陣列 來存放卡牌遊戲的資料庫,可以用來儲存卡牌的屬性,例如 卡牌名稱、攻擊力、防禦力、類型 等。

以下是 卡牌資料庫(Card Database) 的範例:

1. 基本二維陣列存儲卡牌數據

此範例建立一個基本的 卡牌資料庫,並用 Start() 方法來讀取卡牌的資訊。

卡牌名稱 類型 攻擊力 防禦力
水精靈 1800 2200
噴火龍 2500 2000
風暴鷹 1900 1600
冰霜狼 2200 2300
雷鳴豹 2300 1700
聖騎士 2500 2100

 

 

撰寫 CardDatabase 腳本

套用到物件 - 設定文字欄位 - 設定抽牌按鈕。

 

 

執行結果

 

卡牌遊戲特效插件

Holographic Card Shader / Trading Card / Playing Card / Shiny / NFT

https://assetstore.unity.com/packages/vfx/holographic-card-shader-trading-card-playing-card-shiny-nft-250094

 

TCG Engine - Online Card Game

https://assetstore.unity.com/packages/templates/systems/tcg-engine-online-card-game-253269

Card Game Core

https://assetstore.unity.com/packages/templates/systems/card-game-core-284361

Hurray: Color Cards

https://assetstore.unity.com/packages/templates/packs/hurray-color-cards-120992

Checkout Frenzy - Convenience Store Simulator

https://assetstore.unity.com/packages/templates/packs/checkout-frenzy-convenience-store-simulator-310321

TCG Starter - Card Game Template

https://assetstore.unity.com/packages/templates/systems/tcg-starter-card-game-template-268017