void Start() { deckFill = GameObject.FindGameObjectWithTag("Deck"); scale = transform.localScale; isSelected = false; sendButton = sendButon.GetComponent <SendButton2>(); cardIndexToAdd = GetComponent <CardInformation>(); checkCombination = deckFill.GetComponent <CheckCombinations>(); }
void FillingLists() { deckFill = GameObject.FindGameObjectWithTag("Deck"); cardIndexToAdd = GetComponent <CardInformation>(); checkCombination = deckFill.GetComponent <CheckCombinations>(); if (isSelected == true) { if (checkCombination.listOfIndexes.Count < 5) { checkCombination.listOfIndexes.Insert(0, cardIndexToAdd.cardIndex); //fill the lists checkCombination.listOfColors.Insert(0, cardIndexToAdd.color); //fill the lists checkCombination.listOfVec3.Insert(0, transform.position); checkCombination.listOfTargetsToDestroy.Insert(0, gameObject); return; } } if (isSelected == false) { checkCombination.listOfIndexes.Remove(cardIndexToAdd.cardIndex); checkCombination.listOfColors.Remove(cardIndexToAdd.color); checkCombination.listOfVec3.Remove(transform.position); checkCombination.listOfTargetsToDestroy.Remove(gameObject); } /* * switch (isSelected && (checkCombination.listOfIndexes.Count < 5)) * { * case true: * * break; * case false: * break; * } */ }
void Start() { score = gameObject.GetComponent <Text>(); checkedCombinations = deckFill.GetComponent <CheckCombinations>(); }