Hi there,
Sorry to ask this, but with in a coroutine, I have an if/else statement. What I am wondering is, no matter what I try, I can not seem to “return” out of either if true or if false.
//On Mouse click
///Case 1A. active piece == hit transform
if(tf_activePiece == hit.transform){
print("1A");
//potenial moves is active,hide them
if(isPotentialMoves_active){
print("1Aa");
hide_PotentialMoves();
}
//potential moves is inactive,show them
else if(!isPotentialMoves_active){
print("1Ab");
show_PotentialMoves();
}
}
No matter what I do, with one mouse click, both 1Aa and 1Bb are printed. So both cases are called. How do I break the cycle? “return”, “return null”, “return true”, “return false”, “yield return null”, “break”, and creating a case scenario have fallen short for me.
Any tips?
Thanks