void Awake() { if (CardManagerScript.ChecInstanceExit()) { Destroy(this.gameObject); } }
private void Start() { BattleImage = GetComponent <Image>(); CardManagerScript cardMan = FindObjectOfType <CardManagerScript>(); ShowCardInfo(CardManager.AllCards[Random.Range(0, cardMan.CardVariation.Length - 20)]); Debug.Log($" Раса {Race} Сила {ForceCard} Специализация {Specialization} картинка {BattleImage.sprite.name}"); }
public void Fill(string deck_name) { cards_ = new List <int>(CardManagerScript.Instance().GetDeckCards(deck_name)); num_cards_ = cards_.Count; RandomizeCards(); RegenerateEndCardIDs(); RegenerateEndCards(); }
public void PrepareLocal(int card_id) { var card_back = transform.FindChild("Back").transform.FindChild("default"); card_back.renderer.material = CardManagerScript.Instance().GetBackMaterial(card_id); var card_front = transform.FindChild("FrontBorder").transform.FindChild("default"); card_front.renderer.material = CardManagerScript.Instance().GetFrontMaterial(card_id); card_id_ = card_id; }
private void Start() { but = GetComponent <Button>(); CardImage = GetComponent <Image>(); BattleCard = FindObjectOfType <BattleCardScript>(); Sound = FindObjectOfType <SoundScript>(); CardManagerScript cardMan = FindObjectOfType <CardManagerScript>(); game = FindObjectOfType <GameManagerScript>(); DefaultParent = transform.parent; ScaleCard = transform.localScale; transformCard = transform.parent.position; FreeCard = GameObject.Find("FreeCard"); TransFree = FreeCard.transform.position; #region Присваивание рандомного значения карты, в зависимости от хода и введение ее в список руки игрока ShowCardInfo(CardManager.AllCards[Random.Range(0, cardMan.CardVariation.Length)]); game.CurrentGame.PlayerHand.Add(SelfCard); if (game.Road == 1) { game.CurrentGame.PlayerHand.RemoveAt(0); } #endregion }
private void Awake() { current = this; }