public void SetScript(BattleCardScript script) { BattleCardScript = script; BattleCardScript.OnSelectCard += delegate { OnSelect?.Invoke(this); }; }
public bool go = true; //Могут ли враги играть void Start() { CurrentGame = new Game(); GiveHandCards(); battle = FindObjectOfType <BattleCardScript>(); timer = timerBegin; Sound = FindObjectOfType <SoundScript>(); for (int i = 0; i < plusCard.Length; i++) { plusCard[i] = 0; } }
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 }