Last active
July 26, 2018 19:41
-
-
Save shana/fa5e0e903b44dcdb711b2b5a7a3abc2d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Rect lastRect = GUILayoutUtility.GetLastRect(); | |
| if (Event.current.type == EventType.Repaint) | |
| { | |
| if (game == null) | |
| { | |
| game = new Game(); | |
| game.Restart(lastRect); | |
| } | |
| game.Update(); | |
| } | |
| else if (Event.current.type == EventType.MouseUp && lastRect.Contains(Event.current.mousePosition)) | |
| { | |
| game.Click(Event.current.mousePosition); | |
| } | |
| Redraw(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment