Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input #16

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ContentAPI/API/Components/CustomInputHandler.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
namespace ContentAPI.API.Components
{
using ContentAPI.API.Features;
using UnityEngine;

/// <summary>
/// CustomKeybind controller.
/// Custom input handler.
/// </summary>
public class CustomInputHandler : MonoBehaviour
{
private void Update()
{
foreach (Features.Input input in Features.Input.Registered)
foreach (CustomInput input in CustomInput.Registered)
{
if (!Input.GetKeyDown(input.Key))
continue;
Expand Down
17 changes: 0 additions & 17 deletions ContentAPI/API/Components/CustomKeybind.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ namespace ContentAPI.API.Features
/// <summary>
/// Input base class.
/// </summary>
public abstract class Input
public abstract class CustomInput
{
/// <summary>
/// Gets the list of current Item Managers.
/// </summary>
public static HashSet<Input> Registered { get; } = new();
public static HashSet<CustomInput> Registered { get; } = new();

/// <summary>
/// Gets or sets the button to press.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
namespace ContentAPI.Example
{
using ContentAPI.API.Features;
using UnityEngine;
using Input = ContentAPI.API.Features.Input;

/// <summary>
/// KeyBind Showcase.
/// </summary>
public class InputShowcase : Input
public class CustomInputShowcase : CustomInput
{
/// <inheritdoc/>
public override KeyCode Key { get; set; } = KeyCode.Backspace;
Expand Down