File tree Expand file tree Collapse file tree 3 files changed +24
-4
lines changed
Assets/ModalWindows/Scripts Expand file tree Collapse file tree 3 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,8 @@ public virtual T SetHeader(string text)
92
92
93
93
return Instance ;
94
94
}
95
+
96
+
95
97
96
98
public virtual T SetBody ( string text )
97
99
{
@@ -119,6 +121,23 @@ protected virtual void OnBeforeShow()
119
121
}
120
122
}
121
123
124
+ protected virtual void Update ( )
125
+ {
126
+ CheckIgnorableForClose ( ) ;
127
+ }
128
+
129
+ protected virtual void CheckIgnorableForClose ( )
130
+ {
131
+ if ( Input . GetKeyDown ( KeyCode . Escape ) )
132
+ {
133
+ if ( ! ReferenceEquals ( Instance , null ) )
134
+ {
135
+ if ( Instance . ignorable )
136
+ Instance . Close ( ) ;
137
+ }
138
+ }
139
+ }
140
+
122
141
public virtual T Show ( )
123
142
{
124
143
OnBeforeShow ( ) ;
Original file line number Diff line number Diff line change @@ -31,12 +31,11 @@ void SubmitInput()
31
31
Close ( ) ;
32
32
}
33
33
34
- protected void Update ( )
34
+ protected override void Update ( )
35
35
{
36
+ base . Update ( ) ;
36
37
if ( inputField . isFocused && inputField . text != "" && Input . GetKeyUp ( KeyCode . Return ) )
37
- {
38
38
SubmitInput ( ) ;
39
- }
40
39
}
41
40
42
41
public void UI_InputFieldOKButton ( )
Original file line number Diff line number Diff line change 1
- using System . Collections ;
1
+ using System ;
2
+ using System . Collections ;
2
3
using System . Collections . Generic ;
3
4
using UnityEngine ;
4
5
@@ -8,4 +9,5 @@ public class SimpleModalWindow : ModalWindow<SimpleModalWindow>
8
9
{
9
10
return ModalWindow < SimpleModalWindow > . Create ( ignorable ) ;
10
11
}
12
+
11
13
}
You can’t perform that action at this time.
0 commit comments