There was an error while loading. Please reload this page.
1 parent 5aae3a3 commit 1084527Copy full SHA for 1084527
Assets/Behavioral Patterns/State Pattern/Exmaple4/DuckingState.cs
@@ -22,9 +22,14 @@ public void Update()
22
23
public void HandleInput()
24
{
25
- if (Input.GetKeyUp(KeyCode.DownArrow))
+ if (Input.GetKeyDown(KeyCode.DownArrow))
26
27
- Debug.Log("get GetKeyUp.DownArrow!");
+ Debug.Log("已经在下蹲躲避状态中!");
28
+ return;
29
+ }
30
+ if (Input.GetKeyUp(KeyCode.UpArrow))
31
+ {
32
+ Debug.Log("get GetKeyUp.UpArrow!");
33
_heroine.SetHeroineState(new StandingState(_heroine));
34
}
35
0 commit comments