public void CheckIfAllMonkeysAreConvicts()
{
// Let's assume that all monkeys are "inside"
bool rv = true;
foreach(Transform tMonkey in alliedMonkeys) {
CMonkey scriptMonkey = tMonkey.GetComponent<CMonkey>();
if(!scriptMonkey.IsInsideAPrison()) {
// Monkey is free!!!!
rv = false;
}
}
// Ok, we have checked the status of all monkeys. What is the veredict?
if(rv) {
// Start the victory sequence
GameOverStartJailedSequence();
}
}