A demonstration of a State Machine Pattern using a Minesweeper game in Unity https://github.com/daltonbr/Minesweeper
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.