Skip to content

Commit ee1cb6c

Browse files
committed
Use JCS_KeyWith instead of two separate key variables for implementing combination input.
1 parent 1287c04 commit ee1cb6c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Assets/JCSUnity/Scripts/GUI/Undo Redo/JCS_UndoRedoSystem.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,19 @@ public class JCS_UndoRedoSystem
3737

3838
[Tooltip("Undo key.")]
3939
[SerializeField]
40-
private KeyCode mUndoKey = KeyCode.Z;
40+
private JCS_KeyWith mUndoKey = new JCS_KeyWith
41+
{
42+
comb = JCS_KeyCombination.ALT,
43+
key = KeyCode.Z,
44+
};
4145

4246
[Tooltip("Redo key.")]
4347
[SerializeField]
44-
private KeyCode mRedoKey = KeyCode.Y;
48+
private JCS_KeyWith mRedoKey = new JCS_KeyWith
49+
{
50+
comb = JCS_KeyCombination.ALT,
51+
key = KeyCode.Y,
52+
};
4553
#endif
4654

4755

@@ -82,10 +90,10 @@ private void Test()
8290
if (!mTestWithKey)
8391
return;
8492

85-
if (JCS_Input.GetKeyDown(mUndoKey))
93+
if (JCS_Input.GetKeyDownWith(mUndoKey))
8694
UndoComponent();
8795

88-
if (JCS_Input.GetKeyDown(mRedoKey))
96+
if (JCS_Input.GetKeyDownWith(mRedoKey))
8997
RedoComponent();
9098
}
9199
#endif

0 commit comments

Comments
 (0)