summaryrefslogtreecommitdiff
path: root/GameCode/CardInfo.cs
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2023-10-27 11:05:14 +0800
committerchai <215380520@qq.com>2023-10-27 11:05:14 +0800
commit766cdff5ffa72b65d7f106658d1603f47739b2ba (patch)
tree34d7799a94dfa9be182825577583c0fa6dc935f7 /GameCode/CardInfo.cs
+ init
Diffstat (limited to 'GameCode/CardInfo.cs')
-rw-r--r--GameCode/CardInfo.cs68
1 files changed, 68 insertions, 0 deletions
diff --git a/GameCode/CardInfo.cs b/GameCode/CardInfo.cs
new file mode 100644
index 0000000..e0b39fc
--- /dev/null
+++ b/GameCode/CardInfo.cs
@@ -0,0 +1,68 @@
+using Photon.Pun;
+using Sirenix.OdinInspector;
+using UnityEngine;
+
+public class CardInfo : MonoBehaviour
+{
+ public enum Rarity
+ {
+ Common,
+ Uncommon,
+ Rare
+ }
+
+ [Header("Sound Settings")]
+ public bool soundDisableBlockBasic;
+
+ [Header("Settings")]
+ public string cardName = "";
+
+ [TextArea]
+ public string cardDestription = "";
+
+ public CardInfoStat[] cardStats;
+
+ public Rarity rarity;
+
+ public GameObject cardArt;
+
+ public Sprite sprite;
+
+ [HideInInspector]
+ public CardInfo sourceCard;
+
+ public Color cardColor = new Color(0.14509805f, 0.14509805f, 0.14509805f);
+
+ public CardCategory[] categories;
+
+ [FoldoutGroup("Restrictions", 0)]
+ public bool allowMultiple = true;
+
+ [FoldoutGroup("Restrictions", 0)]
+ public CardCategory[] blacklistedCategories;
+
+ public GameObject cardBase;
+
+ public CardThemeColor.CardThemeColorType colorTheme;
+
+ private void Awake()
+ {
+ sourceCard = CardChoice.instance.GetSourceCard(this);
+ cardBase = Object.Instantiate(cardBase, base.transform.position, base.transform.rotation);
+ cardBase.transform.SetParent(base.transform, worldPositionStays: true);
+ bool charge = false;
+ Gun component = GetComponent<Gun>();
+ if ((bool)component && component.useCharge)
+ {
+ charge = true;
+ }
+ cardBase.GetComponent<CardInfoDisplayer>().DrawCard(cardStats, cardName, cardDestription, sprite, charge);
+ cardBase.GetComponentInChildren<GeneralParticleSystem>().particleSettings.randomColor = cardColor;
+ }
+
+ [PunRPC]
+ public void RPCA_ChangeSelected(bool setSelected)
+ {
+ GetComponentInChildren<CardVisuals>().ChangeSelected(setSelected);
+ }
+}