Skip to content

Commit 93a4643

Browse files
author
Your Name
committed
fixed closing ignorable windows on escape button
1 parent 642faf1 commit 93a4643

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Assets/ModalWindows/Scripts/ModalWindow.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ protected virtual void OnBeforeShow()
121121
}
122122
}
123123

124+
protected virtual void Update()
125+
{
126+
CheckIgnorableForClose();
127+
}
128+
124129
protected virtual void CheckIgnorableForClose()
125130
{
126131
if (Input.GetKeyDown(KeyCode.Escape))

Assets/ModalWindows/Scripts/ModalWindows/InputModalWindow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ void SubmitInput()
3636
Close();
3737
}
3838

39-
private void Update()
39+
protected override void Update()
4040
{
41-
CheckIgnorableForClose();
41+
base.Update();
4242
if (inputField.isFocused && inputField.text != "" && Input.GetKeyUp(KeyCode.Return))
4343
SubmitInput();
4444
}

Assets/ModalWindows/Scripts/ModalWindows/SimpleModalWindow.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,4 @@ public class SimpleModalWindow : ModalWindow<SimpleModalWindow>
1010
return ModalWindow<SimpleModalWindow>.Create(ignorable);
1111
}
1212

13-
private void Update()
14-
{
15-
CheckIgnorableForClose();
16-
}
1713
}

0 commit comments

Comments
 (0)