Could someone share some light on what i am missing in this code or is it me?
The cardOK is set to true in the beginning and the code is NOT hitting the if statement “if (cardOK = true && _card.name.Substring(1, 1) == “A”)”, the Coroutine is not accessed, but cardOK still report false in #2?
print("1) " + cardOK); = true
print("2) " + cardOK); = false
Is there anything i am missing here as it should report true as it is set as that in the beginning.
bool cardOK = true;
// CHECK IF CARD(S) MOVED FROM THE SAME LINE AS DROPPED
if (_fromLine == _toLine) {
StartCoroutine(MoveBackCard(_card, _engine.cardDragStartingPosition, _card.GetComponent<Renderer>().sortingOrder));
cardOK = false;
}
print("1) " + cardOK);
// CHECK IF ACE, IF SO MOVE BACK TO SENDER
if (cardOK = true && _card.name.Substring(1, 1) == "A") {
print("HIT");
StartCoroutine(MoveBackCard(_card, _engine.cardDragStartingPosition, _card.GetComponent<Renderer>().sortingOrder));
cardOK = false;
}
print("2) " + cardOK); <<<<< THIS IS FALSE WITHOUT SET TO FALSE