-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shortcut from Activated to Deactivated
- Loading branch information
Craxy
authored and
Craxy
committed
Apr 3, 2015
1 parent
defa780
commit fe13920
Showing
5 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/ToggleTrafficLights/Game/UI/StateMachine/States/ActivatedToHiddenState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using Craxy.CitiesSkylines.ToggleTrafficLights.Utils; | ||
|
||
namespace Craxy.CitiesSkylines.ToggleTrafficLights.Game.UI.StateMachine.States | ||
{ | ||
public class ActivatedToHiddenState : StateBase | ||
{ | ||
#region Overrides of StateBase | ||
|
||
public override State State | ||
{ | ||
get { return State.ActivatedToHidden; } | ||
} | ||
|
||
public override void OnEntry() | ||
{ | ||
base.OnEntry(); | ||
|
||
CloseRoadPanel(); | ||
} | ||
|
||
public override void OnExit() | ||
{ | ||
base.OnExit(); | ||
} | ||
|
||
public override void OnUpdate() | ||
{ | ||
base.OnUpdate(); | ||
|
||
CloseRoadPanel(); | ||
} | ||
|
||
public override Command? CheckCommand() | ||
{ | ||
if (RoadsPanel != null && !RoadsPanel.isVisible) | ||
{ | ||
return Command.HideRoadsPanel; | ||
} | ||
|
||
return null; | ||
} | ||
|
||
#endregion | ||
|
||
private void CloseRoadPanel() | ||
{ | ||
if (RoadsPanel != null && RoadsPanel.isVisible) | ||
{ | ||
CitiesHelper.ClickOnRoadsButton(); | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters