Action Binder Plus is a versatile tool designed to simplify the management of input actions for interactable items, making it ideal for handling complex inventory systems and various interactive elements in your game.
- Flexible Input Binding: Easily bind input actions to various interactable items.
- Inspector Customization: Enhanced editor inspector for intuitive input action management.
- JSON Import/Export: Save and load your input action bindings to/from JSON files.
- Dynamic Action Handling: Automatically handle action execution and cancellation.
- Clone or download the repository.
- Place the
ActionBinderPlus
folder into your Unity project'sAssets
directory.
- Create a new GameObject in your scene and add the
InteractableItem
component. - Configure the
InteractableItem
component:- Assign a target component.
- Set additional options such as
deactivateOnInteract
anddestroyOnInteract
.
- Attach the InputActionManager to an empty gameobject or your "player"
- The InputActionManager requires a PlayerInput component.
- Make sure the PlayerInput component's behaviour is set to invoke unity events.
- Select your
InteractableItem
in the Unity Editor. - In the Inspector, you will see the "Input Action Bindings" section.
- Use the provided interface to add new bindings:
- Unique Binding ID: A unique identifier for the binding.
- Action Name: The name of the input action.
- Method Name: The method to be called on action trigger.
- Additional options based on whether the action should be called immediately, or on started or canceled states.
- Export to JSON: Save your current bindings to a JSON file.
- Import from JSON: Load bindings from a previously saved JSON file.
A simple example is provided in the Samples
folder. You must have TMP installed. The sample was made using the URP pipeline. More examples will be added in the future to demonstrate various use cases and features of the package.
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes.
- Push your branch and create a pull request.
This project is licensed under the MIT License.