private bool SeekAndDestroy() { bool destroyed = false; // seek and destroy blocks foreach (GameObject block_game_object in blocks) { Block block_comp = block_game_object.GetComponent <Block> (); if (block_comp.Color_Index == destroy) { destroyed = true; blocks_to_destroy.Add(block_game_object); } } // seek and destroy requests foreach (GameObject request in requests) { Food.Request request_comp = request.GetComponent <Request> (); if (request_comp.Color_Index == destroy) { requests_to_destroy.Add(request); } } return(destroyed); }
private void SeekAndDestroy() { // seek and destroy blocks foreach (GameObject block_game_object in blocks) { Block block_comp = block_game_object.GetComponent <Block> (); if (block_comp.Color_Index == destroy) { blocks_to_destroy.Add(block_game_object); } } // seek and destroy requests foreach (GameObject request in requests) { Food.Request request_comp = request.GetComponent <Request> (); if (request_comp.Color_Index == destroy) { ; } requests_to_destroy.Add(request); } }