Native Mobile Input
Unity Plugin Documentation
© SkangoGames LLC 2025, All rights reserved.
Features
- ✓ Automatic keyboard handling for Android and iOS
- ✓ Canvas movement when keyboard appears
- ✓ Smooth animations for position changes
- ✓ Custom copy/paste functionality
- ✓ Flexible initialization options
- ✓ Editor simulation for testing
Usage - Basic Setup
- Add the NativeMobileInput component to any GameObject in your scene
- Configure the canvas selection mode:
- AutoDetect: Automatically finds the first suitable canvas
- ManualSelect: Manually assign a specific canvas
- Choose initialization mode:
- Immediate: Initialize on Start
- Delayed: Wait for specified time before initializing
- Manual: Initialize when explicitly called
- Configure the canvas movement when the keyboard appears
- Set up copy/paste button prefabs
Configuration Options
Canvas Settings
- Canvas Selection Mode: Choose between automatic detection or manual assignment
- Target Canvas: Manually assign a canvas (only used when ManualSelect is chosen)
Initialization Settings
- Initialization Mode: Control when the plugin initializes
- Initialization Delay: Time to wait before initialization (for Delayed mode)
General Settings
- Extra Offset: Additional space between keyboard and input field
- Enable For Android: Toggle keyboard handling for Android
- Enable For iOS: Toggle keyboard handling for iOS
Animation Settings
- Enable Smooth Animation: Toggle smooth transitions
- Animation Duration: Duration of smooth animations in seconds
Movement Limits
- Portrait Max Movement: Maximum canvas movement in portrait mode (0-1)
- Landscape Max Movement: Maximum canvas movement in landscape mode (0-1)
Copy/Paste Button Settings
- Paste Button Prefab: Prefab for the paste button
- Copy Button Prefab: Prefab for the copy button
- Long Press Duration: Time to hold for buttons to appear
- Button Offset: Vertical offset for buttons
- Button Size: Width and height of buttons
- Button Spacing: Space between copy and paste buttons
Editor Settings
- Enable Editor Simulation: Toggle keyboard overlay in Unity Editor
Best Practices
- Use ManualSelect mode when you have multiple canvases and want to control each one independently
- Use Delayed or Manual initialization when your UI needs time to set up
- Adjust movement limits based on your UI layout
- Test on different screen sizes and orientations
- Use the editor simulation to test keyboard behavior
Code Examples
Manual Initialization
// Get reference to NativeMobileInput component
public NativeMobileInput mobileInput;
void OnUIReady()
{
// Initialize the plugin when your UI is ready
mobileInput.Initialize();
}
Multiple Canvas Setup
// Add multiple NativeMobileInput components
// Each one can be configured for a different canvas
public NativeMobileInput mainCanvasInput;
public NativeMobileInput popupCanvasInput;
void Start()
{
// Configure each input handler for its specific canvas
mainCanvasInput.targetCanvasManual = mainCanvas;
popupCanvasInput.targetCanvasManual = popupCanvas;
}
🚀 Installation
- Import the 'Native Mobile Input' package into your Unity project
- Add the NativeMobileInput prefab from package prefabs folder to your scene. That's it!
- For Editor simulation, place a keyboard image in
Resources/Keyboard
You can play around with settings now to get best results, even at runtime, no need to reload the scene. If you want to ignore some fields from our plugin, you can, read that in another section in documentation.
🔒 Ignoring Specific Input Fields
To exclude specific input fields from the plugin's behavior:
- Add the
IgnoreNativeMobileInput
component to the input field GameObject
- The plugin will now ignore this input field and won't adjust its position or zoom
// Example
inputField.gameObject.AddComponent<IgnoreNativeMobileInput>();
📜 Scroll View Integration
- Passing drag events from input fields to their parent ScrollRect
- Allowing natural scrolling behavior when touching input fields
- Maintaining proper scroll position during keyboard visibility
📱 Platform Support
- Android: Fully supported with native keyboard handling
- iOS: Fully supported with native keyboard handling
- Editor: Includes keyboard overlay simulation for testing
📋 Requirements
- Unity 2019.4 or later
- TextMeshPro (for TMP_InputField support)
⚠️ Troubleshooting
1. Input Fields Not Moving:
- Verify the canvas render mode
- Ensure the input field isn't marked with IgnoreNativeMobileInput
- Adjust native mobile inputs settings
2. Keyboard Overlay Not Showing in Editor:
- Verify the keyboard image is in the Resources/Keyboard folder
- Check if editor simulation is enabled
3. Scrolling Issues:
- Ensure input fields are properly nested within ScrollRects
- Check if the ScrollRect's content size fits properly.
📄 License
This is proprietary software. All rights reserved. See LICENSE file for full terms and conditions.
For licensing inquiries, please contact: [email protected]
↑