Skip to content

Commit 62ca4ef

Browse files
author
Rene Damm
authored
NEW: Significantly extend and refine rebinding UI support (#993).
1 parent 21f5a98 commit 62ca4ef

File tree

167 files changed

+14924
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+14924
-323
lines changed

Assets/Samples/CustomComposite/CustomComposite.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@
3535
#if UNITY_EDITOR
3636
[InitializeOnLoad]
3737
#endif
38+
// We can customize the way display strings are formed for our composite by
39+
// annotating it with DisplayStringFormatAttribute. The string is simply a
40+
// list with elements to be replaced enclosed in curly braces. Everything
41+
// outside those will taken verbatim. The fragments inside the curly braces
42+
// in this case refer to the binding composite parts by name. Each such
43+
// instance is replaced with the display text for the corresponding
44+
// part binding.
45+
[DisplayStringFormat("{multiplier}*{stick}")]
3846
public class CustomComposite : InputBindingComposite<Vector2>
3947
{
4048
// In the editor, the static class constructor will be called on startup

Assets/Samples/InGameHints.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"displayName": "In-Game Hints",
3+
"description": "Demonstrates how to create in-game hints in the UI which reflect current bindings and active control schemes."
4+
}

0 commit comments

Comments
 (0)