public static ListCardData GetCardsDataBase() { ListCardData _allCards = new ListCardData(); JsonUnitility.ReadJson(ref _allCards, PathToCardsDataBase, PathToDatabase); return(_allCards); }
private void OnEnable() { SaveControllerManager _getSave = new SaveControllerManager(); JsonUnitility.ReadJson(ref _getSave, TCT_PathForSave.filePath, TCT_PathForSave.directoyPath); allActionInput = _getSave.allActionInput; allAxisInput = _getSave.allAxisInput; }
void CreateCard() { if (!canCreate) { return; } Debug.Log("CreateCard"); allCards.dataCards.Add(dataCard); JsonUnitility.WriteOnJson(HAD_PathHelper.PathToCardsDataBase, HAD_PathHelper.PathToDatabase, allCards); AssetDatabase.Refresh(); ResetTool(); }
/// <summary> /// A modifier, /// </summary> /// <param name="_maxCardDeck"></param> /// <returns></returns> public HAD_Deck MakerPreMadeDeck(int _maxCardDeck, Vector3 _deckPosition) { HAD_Deck _currentDeck = new HAD_Deck(_maxCardDeck); for (int i = 0; i < _maxCardDeck; i++) { GameObject _ob = (GameObject)Resources.Load(pathPreMadeDeck); HAD_Card _card = Instantiate(_ob, _deckPosition, Quaternion.identity).GetComponent <HAD_Card>(); //Temp ListCardData allCards = new ListCardData(); JsonUnitility.ReadJson(ref allCards, HAD_PathHelper.PathToCardsDataBase, HAD_PathHelper.PathToDatabase); _card.DataCard = allCards.dataCards[0]; _card.InitializeCard(); // _currentDeck.AddCard(_card); } return(_currentDeck); }
void RefreshData() { SaveControllerManager _current = new SaveControllerManager(allActionInput, allAxisInput); JsonUnitility.WriteOnJson(TCT_PathForSave.filePath, TCT_PathForSave.directoyPath, _current); }