13.03.2016, 10:25
(
Последний раз редактировалось Virtual1ty; 13.03.2016 в 10:55.
)
Hi.
You can't have any code in your 'switch' statement if it's not under a 'case' label (so 'new togglemate=true' etc. will not compile).
You started off good, using 'switch(listitem)' and now you just have to bind actions to that specific listitem response, like setting your variables. To simply toggle a bool variable you can do 'var = !var;', or shorter, but not as readable: 'var ^= 1;'.
You can't have any code in your 'switch' statement if it's not under a 'case' label (so 'new togglemate=true' etc. will not compile).
You started off good, using 'switch(listitem)' and now you just have to bind actions to that specific listitem response, like setting your variables. To simply toggle a bool variable you can do 'var = !var;', or shorter, but not as readable: 'var ^= 1;'.