1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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);
}
}
|