Пример #1
0
        public void CreateSomeCards(CardsList _cardsToGenerate)
        {
            for (int i = 0; i < _cardsToGenerate.Count; i++)
            {
                if (_cardsToGenerate.Get(i).Hand == hand)
                {
                    GameObject _tempCard = Instantiate(_genericPC) as GameObject;
                    _tempCard.transform.SetParent(this.transform);
                    _tempCard.transform.localScale = Vector3.one;
                    _tempCard.GetComponent <GenericPlayCard>()._myCard = _cardsToGenerate.Get(i);
                    _tempCard.name = _tempCard.GetComponent <GenericPlayCard>()._myCard.CName;
                }
            }

            for (int i = 0; i < this.transform.childCount; i++)
            {
                this.transform.GetChild(i).transform.position = this.transform.position + new Vector3((i * 2f), (i * 2f), 0f);
            }
        }
Пример #2
0
        public void UpdateCardList()
        {
            _myCardsJson = "[";
            for (int i = 0; i < cardInventory.Count; i++)
            {
                _myCardsJson += JsonMapper.ToJson(cardInventory.Get(i));
                if (i < cardInventory.Count - 1)
                {
                    _myCardsJson += ",";
                }
            }
            _myCardsJson += "]";
//			File.WriteAllText(Application.dataPath + "/Resources/MyCards/CardsInventory.json", _myCardsJson.ToString());
        }