Skip to content

Key bindings are hard-coded with no serialized override #11

Description

@dmccoystephenson

Problem

The two key bindings in src/CubeFactory.cs are hard-coded literals:

if (Input.GetKeyDown(KeyCode.E))
...
if (Input.GetKeyDown(KeyCode.R) && cubes.Count > 0)

No serialized field exposes either key, so a consuming project that already uses E or R for something else has to edit the script to resolve the collision, which puts the edit outside version control of this repository.

Suggested resolution

Two public KeyCode fields — for example spawnKey defaulting to KeyCode.E and removeKey defaulting to KeyCode.R — would make the bindings configurable per component instance from the Inspector while preserving the current defaults for existing scenes.

This is a feature request rather than a defect, and it widens the component's serialized surface, so it is left for the owner to accept or decline rather than being implemented speculatively. If it is accepted, the README controls table would need to state that the listed keys are defaults.

Verification note

This would change executable code in src/CubeFactory.cs and requires a play-mode run in the Unity Editor to verify. The report above was derived from reading the source, not from an observed run.

This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions