public void Initialize(DeckBuilder parent, CardPlayerData general) { _deckBuilder = parent; generalData = general; SetUpVisuals(); }
public void AssignCustom1Deck(DeckData data) { DeckAssignmentHelper(custom1Grimoire, custom1Domain, defaultSoulCrypt); player.SetUpDecks(); CardPlayerData playerData = data.GetGeneral(); List <CardData> decklist = data.GetCardData(); StartCoroutine(FillCustomDeckLists(playerData, decklist)); }
public void Initialize(DeckBuilder parent, DeckBuilder.DeckData deckData) { _deckBuilder = parent; _deckData = deckData; if (deckData != null) { deckList = _deckData.GetCardData(); general = _deckData.GetGeneral(); faction = general.faction; deckName = _deckData.deckName; deckNameText.text = deckName; } }
public CardPlayerData GetGeneral() { CardPlayerData general = null; List <CardData> deckList = GetCardData(); for (int i = 0; i < deckList.Count; i++) { if (deckList[i] is CardPlayerData) { general = (CardPlayerData)deckList[i]; break; } } return(general); }
public override void OnInspectorGUI() { CardPlayerData _playerData = (CardPlayerData)target; EditorGUILayout.LabelField("General Domains", EditorStyles.boldLabel); _playerData.domainPowers = EditorHelper.DrawList("Domains", _playerData.domainPowers, true, null, true, DrawDomainPowers); EditorGUILayout.Separator(); EditorGUILayout.LabelField("Stats", EditorStyles.boldLabel); _playerData.attack = EditorGUILayout.IntField("Attack", _playerData.attack); _playerData.size = EditorGUILayout.IntField("Size", _playerData.size); _playerData.health = EditorGUILayout.IntField("Health", _playerData.health); base.OnInspectorGUI(); }
private IEnumerator FillCustomDeckLists(CardPlayerData playerData, List <CardData> decklist) { yield return(new WaitForSeconds(1f)); if (playerData != null) { player.activeDomain.GetComponent <Deck>().cards = playerData.domainPowers.Cast <CardData>().ToList(); //for (int i = 0; i < playerData.domainPowers.Count; i++) { // player.activeDomain.GetComponent<Deck>().cards.Add(playerData.domainPowers[i]); //} } player.activeGrimoire.GetComponent <Deck>().cards = decklist; //for (int i = 0; i < decklist.Count; i++) { // player.activeGrimoire.GetComponent<Deck>().cards.Add(decklist[i]); //} //yield return new WaitForSeconds(1f); ShowStartGame(); }