diff --git a/README.md b/README.md index 5a487ff..3ee70ec 100644 --- a/README.md +++ b/README.md @@ -29,124 +29,6 @@ Unity Input System support for Conjure Arcade Controllers. 3. Click the "+" button and select "Add package from disk" 4. Select the `package.json` file from the downloaded folder -## Quick Start - -### Basic Usage - -```csharp -using ConjureOS.Input; -using UnityEngine; - -public class PlayerController : MonoBehaviour -{ - void Update() - { - var controller = ConjureArcadeController.current; - if (controller == null) return; - - // Read stick input - Vector2 stickInput = controller.stick.ReadValue(); - - // Check button presses - if (controller.buttonA.wasPressedThisFrame) - { - // Handle A button press - } - - if (controller.start.wasPressedThisFrame) - { - // Handle start button press - } - } -} -``` - -### Using Input Actions - -1. Create an Input Action Asset in your project -2. Add actions and bind them to Conjure controller inputs: - - Stick: `/stick` - - Buttons: `/buttonA`, `/start`, etc. - -```csharp -using ConjureOS.Input; -using UnityEngine; -using UnityEngine.InputSystem; - -public class InputActionExample : MonoBehaviour -{ - [SerializeField] private InputActionAsset inputActions; - - void Start() - { - // Assign controller 0 to this input action asset - inputActions.AssignConjureController(0); - inputActions.Enable(); - } -} -``` - -### Multi-Controller Support - -```csharp -// Check how many controllers are connected -int controllerCount = ConjureArcadeController.ControllerCount; - -// Get specific controller by index -ConjureArcadeController player1 = ConjureArcadeController.GetForIndex(0); -ConjureArcadeController player2 = ConjureArcadeController.GetForIndex(1); - -// Check if controller exists for index -if (ConjureArcadeController.ExistForIndex(0)) -{ - // Controller 0 is available -} -``` - -## API Reference - -### ConjureArcadeController - -Main controller class that provides access to all inputs. - -**Properties:** -- `stick` - ConjureArcadeStickControl for joystick input -- `home`, `start` - ButtonControl for system buttons -- `button1`, `button2`, `button3` - ButtonControl for numbered buttons -- `buttonA`, `buttonB`, `buttonC` - ButtonControl for lettered buttons -- `ControllerIndex` - The index of this controller instance - -**Static Properties:** -- `current` - Currently active controller -- `allControllers` - Array of all connected controllers -- `ControllerCount` - Number of connected controllers - -**Static Methods:** -- `ExistForIndex(int)` - Check if controller exists for index -- `GetForIndex(int)` - Get controller by index - -**Events:** -- `OnControllerAdded` - Fired when a controller is connected -- `OnControllerRemoved` - Fired when a controller is disconnected - -### ConjureArcadeStickControl - -Custom stick control that provides both Vector2 input and directional buttons. - -**Properties:** -- `up`, `down`, `left`, `right` - ButtonControl for directional input -- Standard Vector2Control properties for analog input - -### InputActionAssetExtension - -Extension methods for InputActionAsset to simplify controller assignment. - -**Methods:** -- `AssignConjureController(int, bool)` - Assign specific controller to asset -- `CanAssignConjureController(int)` - Check if controller can be assigned -- `GetConjureControllerIndex()` - Get assigned controller index -- `GetConjureControllerIndexes()` - Get all assigned controller indexes - ## Input Bindings When setting up Input Actions, use these binding paths: @@ -166,9 +48,3 @@ When setting up Input Actions, use these binding paths: - `/buttonA` - `/buttonB` - `/buttonC` - -## Hardware Information - -The controller is detected as: -- **Interface**: HID -- **Product**: "Generic USB Joystick " (note the extra spaces)