About switch(Different aproach to OnInput)

Switch gives you a plesant option when used with enums. When you put enum variable like on the photo inside switch condition and click enter, then visual studio will automatically generate cases with enum values and breaks(also default). Which is pretty good example how differently you can create OnInput method depending on scene which you are currently in. Hope this will help somebody:)

Write switch -> 2x Tab -> Write Enum variable as condition -> tap enter (that should do)

1 Like

Privacy & Terms