InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

NEW: Code generated by the InputActionCodeGenerator, adding a new constructor with the parameter InputActionAsset.

Open KumoKyaku opened this issue 2 years ago • 5 comments

Description

Code generated by the InputActionCodeGenerator, adding a new constructor with the parameter InputActionAsset.

Changes made

  • Added a new constructor with the parameter InputActionAsset asset to generated class.
  • Re-generated existing actions sets to implement the new functionality.

Checklist

Before review:

  • [x] Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • [ ] Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • [ ] Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • [ ] Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

KumoKyaku avatar Oct 05 '21 06:10 KumoKyaku

CLA assistant check
All committers have signed the CLA.

unity-cla-assistant avatar Oct 05 '21 06:10 unity-cla-assistant

@KumoKyaku thanks for the contribution, could you please clarify what would be the use case for using a constructor with an asset? Current design is based on assumption of generated code being fully encapsulated, e.g. no assets are required to use it after the fact.

jimon avatar Oct 05 '21 13:10 jimon

Ok I see https://forum.unity.com/threads/inputactionasset-generate-c-class-need-a-new-constructor-with-the-parameter-inputactionasset.1178566/

jimon avatar Oct 05 '21 13:10 jimon

How does this progress? I have just written a reasonably substantial workaround due to the lack of functionality that this PR aimed to include. Also in the file InputActionCodeGenerator.cs the very first to do is this. "////TODO: option to allow referencing the original asset rather than embedding it"

DaveRune avatar Feb 08 '23 19:02 DaveRune

would be this ever implemented?

mitay-walle avatar Sep 30 '23 13:09 mitay-walle