-
Notifications
You must be signed in to change notification settings - Fork 324
Added EvaluateMagnitude
override to Vector3Composite
to fix issues with callbacks
#1763
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,7 @@ public class Vector2Composite : InputBindingComposite<Vector2> | |
/// </remarks> | ||
// ReSharper disable once MemberCanBePrivate.Global | ||
// ReSharper disable once FieldCanBeMadeReadOnly.Global | ||
[InputControl(layout = "Axis")] public int up = 0; | ||
[InputControl(layout = "Axis")] public int up; | ||
|
||
/// <summary> | ||
/// Binding for the button represents the down (that is, <c>(0,-1)</c>) direction of the vector. | ||
|
@@ -63,7 +63,7 @@ public class Vector2Composite : InputBindingComposite<Vector2> | |
/// </remarks> | ||
// ReSharper disable once MemberCanBePrivate.Global | ||
// ReSharper disable once FieldCanBeMadeReadOnly.Global | ||
[InputControl(layout = "Axis")] public int down = 0; | ||
[InputControl(layout = "Axis")] public int down; | ||
|
||
/// <summary> | ||
/// Binding for the button represents the left (that is, <c>(-1,0)</c>) direction of the vector. | ||
|
@@ -73,15 +73,15 @@ public class Vector2Composite : InputBindingComposite<Vector2> | |
/// </remarks> | ||
// ReSharper disable once MemberCanBePrivate.Global | ||
// ReSharper disable once FieldCanBeMadeReadOnly.Global | ||
[InputControl(layout = "Axis")] public int left = 0; | ||
[InputControl(layout = "Axis")] public int left; | ||
|
||
/// <summary> | ||
/// Binding for the button that represents the right (that is, <c>(1,0)</c>) direction of the vector. | ||
/// </summary> | ||
/// <remarks> | ||
/// This property is automatically assigned by the input system. | ||
/// </remarks> | ||
[InputControl(layout = "Axis")] public int right = 0; | ||
[InputControl(layout = "Axis")] public int right; | ||
|
||
[Obsolete("Use Mode.DigitalNormalized with 'mode' instead")] | ||
public bool normalize = true; | ||
|
@@ -124,7 +124,7 @@ public class Vector2Composite : InputBindingComposite<Vector2> | |
/// </code> | ||
/// </example> | ||
/// </remarks> | ||
public Mode mode; | ||
public Mode mode = Mode.DigitalNormalized; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a API/behaviorial change (may not be a valid patch) or is it just a case of explicit initialisation? (fine) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I answer my own question, it seems like its not a change since Mode.DigitalNormalized was assigned value zero which would be equivalent to default(Mode), hence this is better in my opinion since explicit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I must admit, I'm a little sad that But yes, this is just a cosmetic change for explicitness and consistency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that inconsistency is indeed sad, something to address when a breaking change can be done. |
||
|
||
/// <inheritdoc /> | ||
public override Vector2 ReadValue(ref InputBindingCompositeContext context) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent to see you've added tests to cover this functionality which seem to have been missing.