Mobile Scene Input Provider
Scene input provider for mobile platforms using on-screen UI buttons.
Setup
- Add
MobileSceneInputProvidercomponent to a GameObject in the scene - Create UI buttons in the scene using
MobileInputButtoncomponents (extends Unity UI Button) - Assign the buttons to the provider:
changeCameraButton- Button to cycle through cameraschangeVehicleButton- Button to switch between vehicles
MobileInputButton
MobileInputButton is an extended Unity UI Button with state tracking:
hasBeenClicked- True for one frame after clicked, then resets automaticallyisPressed- True while button is held down
The MobileSceneInputProvider polls these flags to detect button presses.
Limitations
This provider only handles camera/vehicle switching. Vehicle controls (throttle, steering, brake) require a separate MobileVehicleInputProvider.
Camera rotation, panning, zoom, character movement, and GUI toggle are not supported and return zero/false.