Optos will need a 12 volt supply, and they’re read by the MPU backwards. A standard microswitch is normally open, and when it closes to complete the circuit, it’s registered as a hit.
Optos are read as being normally closed, and when the beam is broken, it opens the circuit and the MPU registers it as a hit.
So while you could very likely piggy back a 12 volt supply, you’d still have to change the programming/code to tell the software what would constitute a hit, otherwise the game will just see the converted ramp switch as always being permanently closed.