How to script a button that removes all materials and restores then when clicked again

return exits out of the function and does not continue the loop, continue however skips the current index in a loop and the loop continues with the next index. This is useful when you don’t want to nest your code in a lot of if statements.